应用程序迁移从Tomcat 7(与JDK 1.7)至WildFly 10(与JDK 1.8) -

2019-11-05 06:38发布

我从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项目,它有下CXF-2.6.2.jar:\ SRC \主\ web应用\ WEB-INF \ lib中

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部署-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部署,structure.xml

文章来源: Application migration from Tomcat 7(with jdk 1.7) to WildFly 10(with jdk 1.8) - CXF