cvc-elt.1: 找不到元素 'beans' - applicationcontext.xml 的声明
cvc-elt.1: Cannot find the declaration of element 'beans' - applicationcontext.xml
我最后只收到这个错误:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自 class 路径资源 [applicationContext.xml] 的 XML 文档中的第 12 行无效;嵌套异常是 org.xml.sax.SAXParseException;
cvc-elt.1: 找不到元素 'beans' 的声明。
我看到已经存在 bean 的声明
有人可以帮我解决我到底哪里出错了吗?
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-3.0.xsd">
<mvc:annotation-driven>
</mvc:annotation-driven>
Spring 目前的 jar 是 4.1.6。
这是您更正后的文件:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-3.0.xsd">
<mvc:annotation-driven>
</mvc:annotation-driven>
</beans>
你写的是xsi:schemalocation
而不是xsi:schemaLocation
(注意大写L)
有关 xsi:schemaLocation
的更多信息:
XML 解析器将从 Internet 读取模式位置并使用它来验证 xml。如果您无法访问互联网(就像大多数无法访问互联网的高效系统一样),Spring 会派上用场。它解释读取请求并从 Spring 罐子中加载模式。
我最后只收到这个错误: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自 class 路径资源 [applicationContext.xml] 的 XML 文档中的第 12 行无效;嵌套异常是 org.xml.sax.SAXParseException; cvc-elt.1: 找不到元素 'beans' 的声明。 我看到已经存在 bean 的声明
有人可以帮我解决我到底哪里出错了吗?
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-3.0.xsd">
<mvc:annotation-driven>
</mvc:annotation-driven>
Spring 目前的 jar 是 4.1.6。
这是您更正后的文件:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-3.0.xsd">
<mvc:annotation-driven>
</mvc:annotation-driven>
</beans>
你写的是xsi:schemalocation
而不是xsi:schemaLocation
(注意大写L)
有关 xsi:schemaLocation
的更多信息:
XML 解析器将从 Internet 读取模式位置并使用它来验证 xml。如果您无法访问互联网(就像大多数无法访问互联网的高效系统一样),Spring 会派上用场。它解释读取请求并从 Spring 罐子中加载模式。