2014-11-07 72 views
0

考慮下面的代碼:阿帕奇MQ transportConnectors URI值問題

<amq:transportConnectors> 
     <amq:transportConnector uri="${esb.endpoint}"/> 
    </amq:transportConnectors> 

這是不能夠解決的URI值。我得到的錯誤是:

STACKTRACE: 
at com.mincom.util.gadget.Starter.run(Starter.java:40) 
THROWABLE: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean 
definition with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class 
path resource [minestar/esbadapter/service/EsbEmbeddedApacheContext.xml]: Could not 
resolve placeholder 'esb.endpoint' in string value "${esb.endpoint}"; nested exception 
is java.lang.IllegalArgumentException: Could not resolve placeholder 'esb.endpoint' in 
string value "${esb.endpoint}" 

我在這裏做錯了什麼嗎?

+0

你在哪裏設置esb.endpoint的值? – CharlieS 2014-11-07 03:11:28

+0

@CharlieS在jms屬性文件中:'esb.endpoint = tcp:// localhost:61616' – 2014-11-07 03:14:21

+0

似乎沒有找到屬性,你如何指定屬性文件?是否正在查找其他屬性集? – CharlieS 2014-11-07 03:21:34

回答

0

這是很明顯的是,春天是無法找到的屬性文件 最簡單的辦法就是看配置的屬性文件

我的辦法是做這樣的:

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

此你將需要添加在你的春天命名空間下

xmlns:context="http://www.springframework.org/schema/context" 
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd 

希望它能幫助,

祝你好運!

+0

將類路徑代替'location =「required.properties」' – 2014-11-10 09:30:07

+0

當然,你可以做一些類似於 Vihar 2014-11-10 13:52:46