web.xml报错Referenced file contains errors

今天在配置Spring + Mongodb 环境时,出现了一个令人诧异的Error,如图所示:


看了网络上的评论,捣鼓了半天也没成功。后来一想会不会是版本问题,结果还真是。

解决方案如下:

1. 首先为了确保 Eclipse 可以从远程拿到 xsd 文件,到 Window -> Preferences -> General -> Network Connections -> Cache 下的 Cache entries 框内检查所需要的文件是否正确,如果不确定,就点击 "Remove All",然后右击当前的 Project 选择 Validator,Eclipse 会重新加载 xsd 文件;



2. 如果错误依旧,那就需要删掉 xsd 文件的版本号,例如:

http://www.springframework.org/schema/context/spring-context-3.0.xsd

改成: http://www.springframework.org/schema/context/spring-context.xsd

3. 例如

提示版本错误信息

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

修改前信息

xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
Spring-beans.xsd改成Spring-beans-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值