当前位置: 代码迷 >> 综合 >> java.lang.IllegalArgumentException: Could not resolve placeholder
  详细解决方案

java.lang.IllegalArgumentException: Could not resolve placeholder

热度:22   发布时间:2023-12-17 00:32:39.0

当在配置文件中写了两处:

<bean id="propertyConfigurer"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="location" value="classpath:jdbc.properties" /></bean>

就会找不到第一个配置文件中的属性…
引入多个,应该这么写:

  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="locations"><list><value>classpath:test.properties</value><value>classpath:jdbc.properties</value></list></property></bean>
  相关解决方案