Cannot find the declaration of element 'beans'. 的解决方法

2 篇文章 0 订阅
转载自:http://blog.csdn.net/wengang285/article/details/7587264
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.

如果在项目中遇到该异常,通常是项目无法下载到spring-beans-2.5.xsd文件而出现的问题,这里的版本号因项目版本而异。

这里需要配置本地的xsd文件,方法如下:

找到你的项目中引用的spring的核心包,spring.jar

用压缩文件打开,找到该路径

org/springframework/beans/factory/xml/

并将这个路径下的xsd文件以下列形式配置到applicationContext.xml文件中,如果有多个配置文件,则全部代替

即以

classpath:/org/springframework/beans/factory/xml/spring-beans-2.5.xsd

代替

 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 

使得从本地直接读取该配置文件

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值