2013-06-26 4 views
0

Mule의 .properties 파일에서 값을로드하려고하는데 파일이 명확하게 존재하면 FileNotFound 예외가 발생합니다. 상대 경로를 사용하여 프로젝트 디렉토리 안에 파일을 넣으려고했지만 아무 것도 작동하지 않습니다. 여기Mule의 .properties 파일에서로드하는 동안 FileNotFound 예외가 발생했습니다.

내 뮬 흐름에서 관련 물건을입니다 -이 문제 과거를 얻을 수있는 방법이

<?xml version="1.0" encoding="UTF-8"?> 

<mule 
xmlns:context="http://www.springframework.org/schema/context" 
xmlns:file="http://www.mulesoft.org/schema/mule/file" 
xmlns="http://www.mulesoft.org/schema/mule/core" 
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" 
xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" 
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" 
xmlns:spring="http://www.springframework.org/schema/beans" 
xmlns:core="http://www.mulesoft.org/schema/mule/core" 
version="EE-3.4.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd 
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd 
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

<context:property-placeholder location="C:\path\to\file\settings.properties" /> 

<oracle data source info /> 
<connector info /> 
<flow name="temp" doc:name="Temp" > 
<other stuff /> 
</flow> 
</mule> 

있습니까?

답변

2

는 클래스 패스 (직접 SRC에서/주/자원/프로젝트에서)에 settings.properties 파일을 넣고 같이 그것을 참고 : 기본적으로

<context:property-placeholder location="settings.properties" />

2

컨텍스트 속성 자리 표시 자 모양을 클래스 패스에.

파일이있는 실제 경로에서 파일을 찾으려면 다음 구성을 사용하십시오.

<context:property-placeholder location="file:C:/path/to/file/settings.properties" /> 

이렇게하면됩니다.

가장 선호되는 방법은 속성 클래스 파일을 프로젝트 클래스 경로에 유지하는 것입니다.

희망이 도움이됩니다.

관련 문제