org.springframework.beans.factory.BeanDefinitionStoreException:

 

beans.factory.BeanDefinitionStoreException 问题出在beans.factory,那么到底是哪呢?spring的配置文件里,也就是你要加载的配置文件beans,找到的对象是空,

出错的常见情况:

spring版本不一致,比如有的用Spring2.0,3.0

举例:

在往Spring2.0项目中添加XFire时(Myeclipse)出现如下错误
Document root element "beans", must match DOCTYPE root "null".
原因:XFire Core lib 中有Spring1.2.6 与Spring 2 冲突!

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
</beans>


spring 1.x 使用DOCTYPE,而2.x是用schema,把
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
删掉,改为
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" " http://www.springframework.org/dtd/spring-beans.dtd">
<beans></beans>

往往在myeclipse中添加spring支持时,需要选择版本,后来在eclipse工具中用到spring的web工程,不想装myeclipse,就遇到这个问题了,不过不是很难。

 

继续练习,用eclipse学东西自己安装需要的插件,觉得学的清晰些,整个过程比较清晰,个人建议而已。

当然零基础的还是用 myeclipse比较,有现成的工具,就直接用!

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值