PropertyPlaceholderConfigurer配置找不到properties文件异常

applicationContext.xml内配置如下:

<bean

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />

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

<property name="locations">

<list>

标准配置

<value>classpath*:application.properties</value>

</list>

</property>

</bean>

报错

Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 20 in XML document from URL is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.3: Element 'list' cannot have character [children], because the type's content type is element-only.

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)

修改为3.0后的配置

<context:property-placeholder location="file:D:/application.properties"/>

posted @ 2012-12-25 14:26  Alex~  阅读(7343)  评论(2编辑  收藏  举报