如題:
導致這一問題的原因:使用了重復的property-placeholder
如一個配置文件中使用了
<context:property-placeholder location="classpath:aa.properties" />
而另一處使用了
<bean id="propertyConfigurer"> <!--class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">--> <property name="locations">--> <list> <value>classpath:bb.properties</value> </list> </property> </bean>
解決:
主要從以下幾個地方去解決:
1. 去掉一處的propertyConfigurer配置,替換成context:property-placeholder
2. 兩處都添加ignore-unresolvable="true"
配置文件1:
<context:property-placeholder location="classpath:aa.properties" ignore-unresolvable="true" />
配置文件2:
<context:property-placeholder location="classpath:bb.properties" ignore-unresolvable="true" />