Cannot find the declaration of element 'beans' spring xml文件报错解决办法

本文介绍了一种常见的Eclipse开发环境中Spring XML配置文件出现的错误:找不到bean元素的声明。通过调整Eclipse的XML文件验证设置来解决该问题。

相信不少人都遇到过这种情况,提示spring 的xml文件找不到bean元素的声明。

Multiple annotations found at this line:
    - cvc-elt.1: Cannot find the declaration of element 'beans'.
    - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-4.1.xsd', because 1) could not find the document; 2) the document could not be 
     read; 3) the root element of the document is not <xsd:schema>.

网上有好多办法,好多说是spring的版本不对,这是其中的一种情况。我的文件是直接在GitHub上down下来的,所以不是版本的问题,找了半天,发现原因是因为eclipse的验证机制出现的错误,直接将xml文件的验证关掉就可以解决这个问题。将xml文件相关的自动验证关闭,如下图

这里写图片描述

评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值