天天看點

Spring讀取配置檔案org.springframework.beans.factory.BeanCreationException異常産生的原因和解決方案

一般出現這種問題有可能是因為系統需要讀取多個配置檔案造成的,是以此時就需要配置

<property name="ignoreUnresolvablePlaceholders" value="true" />
           

完整spring.xml讀取properties檔案代碼如下如下:

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