Eclipse中xml配置最上边报错Multiple annotations found at this line: - Referenced file contains errors (http:

解决Eclipse中XML最上边报错Multiple annotations found at this line:

- Referenced file contains errors (http://www.springframework.org/schema/aop/spring-aop-4.1.xsd). For more information, right click on the message in the Problems View and select "Show 
 Details..."
- Referenced file contains errors (http://www.springframework.org/schema/context/spring-context.xsd). For more information, right click on the message in the Problems View and select "Show 
 Details...

第一种解决办法,将箭头指向的地方的版本号删除

在这里插入图片描述

第二种方法

第一步依次点击Window>Preferences
然后点击XML>XML Files >Validation,取消勾选:Honour all XML schema locations,这告诉eclipse,不再验证不同schema位置的相同命名空间的引用,仅以第一次找到的可验证的XML文件为结果。 然后点击下面的Apply and Close按钮,如下图所示.
在这里插入图片描述
在弹出来的窗口选择是即可
在这里插入图片描述

这样一般就解决了绝大多数的问题,当然如果这些都解决不了,还有一个办法

第三种办法

修改xmlns:dwr和spring-context的版本号一致
在这里插入图片描述
如果没有xmlns:dwr可手动添加

xmlns:dwr="http://directwebremoting.org/schema/spring-dwr/spring-dwr-2.4.xsd"

版权声明:本文为weixin_43235147原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。