Миграция приложения с Tomcat 7 (с jdk 1.7) на WildFly 10 (с jdk 1.8) - CXF - PullRequest
0 голосов
/ 30 октября 2018

Я переносу приложение из Tomcat 7 (с jdk1.7) в Wildfly 10 (с jdk 1.8). Веб-сервисы построены на Apache CXF. (я развернул автономную войну)

my 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 \ main \ webapp \ 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-deploy-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-deploy-structure.xml

...