spring整合xfire出现Document root element "beans", must match DOCTYPE root "null"错误解决方案

来源:互联网 发布:淘宝买自行车靠谱吗 编辑:程序博客网 时间:2024/06/08 11:13

maven+spring整合xfire出现如下错误:

org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".  

原因:

xfile-spring中包含了spring1.x的包,与spring2.x包冲突

解决方案:

1.将原配置文件的头schema方式换为DOCTYPE方式//此方案太麻烦,如果未使用maven管理可考虑

2.在pom.xml中引用xfile部分进行修改,代码如下:

<dependency>    <groupId>org.codehaus.xfire</groupId>    <artifactId>xfire-spring</artifactId>    <version>1.2.6</version>    <exclusions>    <exclusion>    <groupId>org.springframework</groupId>    <artifactId>spring</artifactId>    </exclusion>    </exclusions></dependency>
0 0
原创粉丝点击