我正在将应用程序从Tomcat 7(带有jdk1.7)迁移到Wildfly 10(带有jdk 1.8)。 Web服务基于Apache CXF构建。 (我发动独立战争)
我的web.xml:
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping>
这不是Maven项目,它在\ src \ main \ webapp \ WEB-INF \ lib下具有cxf-2.6.2.jar
cxf-appcontext.xml就像:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<bean name="myWebService" class="com.xx.xx.xx.ws.myWebService"
p:myService-ref="myService" />
<jaxws:endpoint id="myWebServiceEndpoint"
implementor="#myWebService" address="/mySegmentationWS" />
<cxf:bus>
<cxf:inInterceptors>
<ref bean="loggingInInterceptor" />
</cxf:inInterceptors>
</cxf:bus>
</beans>
但是我遇到了以下错误:
WFLYWS0059: Apache CXF library (cxf-2.6.2.jar) detected in ws endpoint deployment; either provide a proper deployment replacing embedded libraries with container module dependencies or disable the webservices subsystem for the current deployment adding a proper jboss-deployment-structure.xml descriptor to it. The former approach is recommended, as the latter approach causes most of the webservices Java EE and any JBossWS specific functionality to be disabled.
我尝试了一些jboss-deployment-structure.xml版本。但是他们也没有工作。
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<module name="org.apache.cxf.impl" export="true">
<imports>
<include path="META-INF**" />
<include path="META-INF/cxf**" />
</imports>
</module>
<module name="org.apache.cxf" export="true">
<imports>
<include path="META-INF**" />
<include path="META-INF/cxf**" />
</imports>
</module>
</dependencies>
</deployment>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclude-subsystems>
<subsystem name="webservices"/>
<subsystem name="jaxrs"/>
</exclude-subsystems>
<exclusions>
<module name="javax.ws.rs.api"/>
<module name="org.apache.cxf"/>
<module name="org.apache.cxf.impl"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
我认为,我不完全了解jboss-deployment-structure.xml