Spring读取配置文件org.springframework.beans.factory.BeanCreationException异常产生的原因和解决方案

来源:互联网 发布:国内算法班 编辑:程序博客网 时间:2024/06/05 10:09

一般出现这种问题有可能是因为系统需要读取多个配置文件造成的,所以此时就需要配置

<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>



1 0