日期:2014-05-19  浏览次数:20710 次

Spring2.0和Xfire1.2.6集成的问题
Xfire内置支持Spring1.x,由于项目的需要,需设置成支持Spring2.0

加入Library Spring2.0.6, XFire1.2.6

web.xml设置如下:
<?xml version="1.0" encoding="GB18030"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/ApplicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>XFireServlet</servlet-name>
<servlet-class>
org.codehaus.xfire.spring.XFireSpringServlet
</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>XFireServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>





ApplicationContext.xml设置如下:

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

<import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />

</beans>







------解决方案--------------------
我同意版主的意见,真的需要用xfire1.2.6 +spring2.0集成的看看了(不知道有没有成功的了),上面那个人不知道说什么风凉话了,如果把spring1.2.6 的删掉classpath:org/codehaus/xfire/spring/xfire.xml不就没有了吗?还怎么集成呀
------解决方案--------------------
容器初始失败