spring整合xfire出现Document root element "beans", must match DOCTYPE root "null"错误解决方案
2024-08-27 22:43:35
fire自带的包下有个spring1.2.6的jar包,而工程的jar包是2.0的。
解决方案:
1.将原配置文件的头schema方式换为DOCTYPE方式,原配置文件如下(非maven)
- <?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">
- <bean id="helloWS" class="com.HelloWorld"/>
- <bean id="addressingHandler" class="org.codehaus.xfire.addressing.AddressingInHandler"/>
- <bean name="helloService" class="org.codehaus.xfire.spring.ServiceBean">
- <property name="serviceBean" ref="helloWS"/>
- <property name="serviceClass" value="com.IHelloWorld"/>
- <property name="inHandlers"><list><ref bean="addressingHandler"/></list></property>
- </bean>
- </beans>
改成:
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
- <beans>
- <bean id="helloWS" class="com.HelloWorld"/>
- <bean id="addressingHandler" class="org.codehaus.xfire.addressing.AddressingInHandler"/>
- <bean name="helloService" class="org.codehaus.xfire.spring.ServiceBean">
- <property name="serviceBean" ref="helloWS"/>
- <property name="serviceClass" value="com.IHelloWorld"/>
- <property name="inHandlers"><list><ref bean="addressingHandler"/></list></property>
- </bean>
- </beans>
2.maven环境下建pom.xml的xfire调整以下:
<!-- xfire 1.2.6 -->
<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>
重新发布即可
最新文章
- HttpRequestUtil
- Sharepoint2013:日期控件报错
- python脚本实现集群检测和管理
- hdu5441(2015长春赛区网络赛1005)类最小生成树、并查集
- Android中ListView滚动时上下边界的那一抹色彩
- bzoj 4006 [JLOI2015]管道连接(斯坦纳树+状压DP)
- BZOJ 1927: [Sdoi2010]星际竞速 费用流
- sql server varchar(10)和 nvarchar(10)存储数据长度
- 它们的定义actionbar 并删除留空
- http请求连接
- EJB基础知识
- docker swarm的常用操作
- MongoDB的客户端管理工具--nosqlbooster 连接MongoDB服务器
- vs 2015 编译cocos2d-x-3.9
- 使用gulp压缩js详细步骤笔记
- 微信小程序开发语言的选择
- Mininet安装
- 聊聊javascript的null和undefined
- VC++6.0中碰到Cannot access the ClassView information file.ClassView information will not be avaible.的解决方法
- 1.ideal常用快捷键