2014-11-07 75 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