天天看点

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>