Java Spring配置错误:(cvc etl.1)

Java Spring配置错误:(cvc etl.1),java,spring,jsp,Java,Spring,Jsp,我想尽了一切办法,但似乎都不管用 我正在java web应用程序中使用当前版本的Spring Framework(3.2)。 每次启动项目时,我都会出现以下错误: cvc elt.1:找不到元素“bean”的声明 这是我的applicationContext.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xml

我想尽了一切办法,但似乎都不管用

我正在java web应用程序中使用当前版本的
Spring Framework(3.2)
。 每次启动项目时,我都会出现以下错误:

cvc elt.1:找不到元素“bean”的声明

这是我的applicationContext.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
     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-3.0.xsd"

</beans>


当我将xsd粘贴到浏览器中时,它对我来说很好

这个对我来说很好:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:annotation-config/>
    <context:component-scan base-package="example"/>

</beans>


Spring在查找XSD时遇到问题。看一看。如果您确定在类路径中有所需的SpringBeans jar,则可能有一个损坏的META-INF/spring.schemas文件。schemas文件告诉spring使用哪个类路径在spring JAR中查找相应的xsd文件。我在使用maven shade插件时出现过这种情况。

我的计算机未连接到internet,因此无法运行此测试