如下所示,直接写多个<context:property-placeholder>标签是会报错的。

    <context:property-placeholder location="classpath:wechat/official-account.properties" />
    <context:property-placeholder location="classpath:db.properties" />

 

即便是写在不同的xml里面,只要最终被application-context.xml的<import>标签所引入,都是会报错的。

正确的做法追加一个ignore-unresolvable属性,每个property-placeholder都需要加。

    <context:property-placeholder location="classpath:wechat/official-account.properties" ignore-unresolvable="true" />
    <context:property-placeholder location="classpath:db.properties" ignore-unresolvable="true" />

 

相关文章:

  • 2022-01-31
  • 2021-11-13
  • 2021-10-12
  • 2022-02-19
  • 2021-11-19
  • 2021-11-19
  • 2021-07-13
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-11-19
  • 2021-11-19
  • 2021-07-22
相关资源
相似解决方案