解决eclipse spring配置报错:cvc-elt.1: Cannot find the declaration of element

Posted Simple is Awesome

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决eclipse spring配置报错:cvc-elt.1: Cannot find the declaration of element相关的知识,希望对你有一定的参考价值。

解决eclipse spring配置报错:cvc-elt.1: Cannot find the declaration of element \'beans\'.
Referenced file contains errors (http://www.springframework.org/schema/aop/spring-aop-3.1.xsd).

原因是无法从网络上读取到相应的schema文件,但实际上在浏览器中是可以访问的。
却一直在eclipse中显示红叉,当然,并不影响编译打包。

 

查看所依赖的jar包文件中是否真的存在相应的schema文件。

 

如果maven依赖的jar包已经存在相应schema文件,直接改为本地classpath依赖路径即可。

配置为本地classpath依赖路径之后,eclipse中的红叉报错提示消失。

 

参考:http://blog.csdn.net/legendj/article/details/9950963

以上是关于解决eclipse spring配置报错:cvc-elt.1: Cannot find the declaration of element的主要内容,如果未能解决你的问题,请参考以下文章

Spring配置文件里xsd找不到时解决方案

配置文件报错:cvc-complex-type.2.4.a: Invalid content was found starting with element filter

spring的xml配置声明以及相应的问题处理

spring开启事务时启动报错SAXParseException

Spring配置报错- 元素 'beans' 必须不含字符 [子级]

《Spring实战》-- 'cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be