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>
重新发布即可