`
lzj0470
  • 浏览: 1249585 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Could not resolve placeholder 解决方案

 
阅读更多
错误场景
一个工程(A)以多个工程(B\C\D...)相关联,而某些工程会用到自己的配置文件。如:
B工程配置文件引用settings.xml
<context:property-placeholder location="classpath:settings.xml" ignore-resource-not-found="true" />

C工程配置文件引用elasticSettings.properties
<util:properties id="elasticSettings" location="classpath:elasticSettings.properties" />
<context:property-placeholder properties-ref="elasticSettings"/>

A工程配置文件引用B工程和C工程配置文件
<import resource="classpath:B工程配置文件" />
<import resource="A工程配置文件"/>


错误异常
Could not resolve placeholder “es.nodes”...


解决办法
在第一次引用
context:property-placeholder
地方加上
ignore-unresolvable="true"
。如:
<context:property-placeholder location="classpath:settings.xml" ignore-resource-not-found="true" ignore-unresolvable="true"/>


参考资料
http://tracyhuyan.iteye.com/blog/1336946
http://www.blogjava.net/DLevin/archive/2011/09/08/358246.html
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics