问题描述
- context:property-placeholder 不能解析xml中配置的键值
-
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 9 in XML document from URL [file:/E:/PT/Installtomcat/webapps/SSHTest1/WEB-INF/classes/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 61; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 'context:property-placeholder' 的声明。
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
!!!!!!!!!!!!!!!!
代码如下:
解决方案
解决方案二:
解决了。是包的问题。。我重搭了一个框架就好了!!!你可能少导入了那个包吧!!!!
解决方案三:
我的和你一样的问题,但是还是报错是怎么回事
解决方案四:
在引入命名空间时还要正确引入context的DTD解析文件
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
时间: 2024-08-28 05:29:50