java使用spring框架配置文件时遇到的错误——Referenced file contains errors

报错信息:

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

  

  

这个错误在网上也找了很多解决方法,但是我用的是Myeclipse进行开发的,有些解决方法不能用,所以我就自己琢磨了一下报错信息,eclipse应该也同样适用。

首先观察报错信息:

  引用的文件包含错误 (http://www.springframework.org/schema/beans/spring-beans-4.3.xsd)

  应该是加载spring-beans-4.3.xsd出现的错误,其他人的报错信息有可能是:http://www.springframework.org/schema/beans/spring-beans-X.X.xsd(它报错的版本有可能不同,和你安装的spring版本有关)

  这里应该是无法下载spring-beans-4.3.xsd这个版本的插件,所以你自己设置一个版本号,当然要比4.3小的就可以。

  例如

  

  现在没有任何报错,完美解决。

   

这里贴上其他人写的关于eclipse使用spring配置时的解决方法。

 https://blog.csdn.net/zlj1217/article/details/61432437

原文地址:https://www.cnblogs.com/aishanyishi/p/10054172.html