美文网首页
Document root element beans , mu

Document root element beans , mu

作者: 无愠无殇 | 来源:发表于2016-11-09 10:53 被阅读246次

在往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>

详情见博客

相关文章

网友评论

      本文标题:Document root element beans , mu

      本文链接:https://www.haomeiwen.com/subject/ibizuttx.html