【发布时间】:2015-12-19 16:55:24
【问题描述】:
我最终只得到这个错误: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自类路径资源 [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。
【问题讨论】:
-
缺少一个>
-
要是这么简单就好了。这是我从外部机器粘贴的错误副本。它在源代码中确实有一个 > ,但我仍然得到同样的错误。谢谢你在这里捕捉到。我将编辑问题
-
你能告诉我们至少 12 行吗?错误似乎发生在第 12 行
-
@Alexandre Jacob:我刚刚用 applicationContext 文件更新了我的问题。如果您发现任何问题,请告诉他们