6 Replies Latest reply on Feb 9, 2017 2:11 AM by def321

    CXF problems while migrating to EAP 7

    def321 Newbie

      Hello,

       

      I'm trying to migrate an application from JBoss EAP 6.2 to EAP 7 (pretty sure the applications also runs on EAP 6.4 but I didn't check it lately). The application is a webservice with an own apache cxf implementation. Therefore I disabled the JBoss ws implementation via "jboss-deployment-structure.xml" in EAR/META-INF:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
      
          <deployment>
      
              <exclude-subsystems>
                  <subsystem name="webservices" />
                  <subsystem name="jaxrs" />
              </exclude-subsystems>
      
          </deployment>
      
          <sub-deployment name="xxWeb.war">
              <dependencies>
                  <module name="org.jboss.xnio" />
                  <module name="org.apache.xerces" />
              </dependencies>
          </sub-deployment>
      
          <sub-deployment name="xxEJB.jar">
              <dependencies>
                  <module name="org.apache.xerces" />
              </dependencies>
          </sub-deployment>
      
      </jboss-deployment-structure>

       

      In JBoss 6.x EAP it works like a charm. In JBoss 7.0.0 I get the following error while deploying:

      14:18:25,396 WARN  [org.jboss.modules] (MSC service thread 1-1) Failed to define class org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider in Module "deployment.xx.ear:main"

      from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider (Module "deployment.xx.ear:main" from Service M

      odule Loader): javax/xml/ws/Provider

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

              at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)

              at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)

              at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)

              at org.jboss.modules.Module.loadModuleClass(Module.java:605)

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

              at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.loadClassInfoSet(ServletContainerInitializerDeploymentProcessor.java:254)

              at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:166)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

              at java.lang.Thread.run(Thread.java:745)

       

      Can you help me out? What is my mistake?

       

      P.S. I also tried:

      <exclusions>
           <module name="org.jboss.as.webservices.*" />
           <module name="org.jboss.ws.*" />
      </exclusions>
      
        • 1. Re: CXF problems while migrating to EAP 7
          Viral Gohel Newbie

          Hi,

           

          The missing class is there in cxf-rt-ws-security.jar. Can you make sure you have included this on the application classpath ?

          You can also disable the JBossWS default stack globally for all applications by commenting the below in your standalone.xml file.

           

          <extensions>
            ...
            <!-- <extension module="org.jboss.as.webservices"/> -->
            ...
            </extensions>

          • 2. Re: CXF problems while migrating to EAP 7
            def321 Newbie

            Hi Vira Gohel,

             

            thanks for your reply.

             

            I tried it with and without the webservices-modul in standalone.xml. There is no difference. It also should work even if the webservice-modul is activated, because I don't know which other applications are installed on the server. Also on JBoss EAP 6.2 the webservices-modul is activated and it still works.

             

            I have an older version of cxf (2.12). The class SecurityTokenServiceProvider is located at the jar cxf-bundle.jar which is located in the ear. As the same EAR is working on JBoss EAP 6.2 I guess it should be at the right position in the EAR (also it works on IBM's WebSphere v. 8.0 and 8.5).

             

            Furthermore I doublechecked that the Provider-class is within the JRE I started the server with (JRE version 1.8.0_112). So the classes should all be there.

            • 3. Re: CXF problems while migrating to EAP 7
              Viral Gohel Newbie

              The  cxf bundle jar has been removed due to maintenance issues So, users should upgrade to the individual modules that they need for their application. Hence you will need to provide the respective jars in the application.

              Regarding if jbossws is disabled or not, are you able to see this line in your server log ?

               

              INFO  [org.jboss.ws.common.management] (MSC service thread 1-7) JBWS022052: Starting JBoss Web Services - Stack CXF Server

              If yes, then the subsystem is still activated. If not, then its not activated.

              • 4. Re: CXF problems while migrating to EAP 7
                def321 Newbie

                I don't want to use the JBoss cxf implementation. I want to use my own cxf implementation. My EAR contains the cxf-bundle.jar. This is the reason why I want to disable the webservices module / extension.

                 

                I don't see the given line in the log (no matter if it is included in the standalone.xml or not; maybe it will start in lazy mode if it is needed?).

                • 5. Re: CXF problems while migrating to EAP 7
                  Viral Gohel Newbie

                  If you don't see the log line, it means that jbossws is disabled and not used.  You will need to put the the jar in the subdeployment application classpath that needs it.  I suppose you are getting this issue while deploying the application and not while accessing it.

                  Why not create a custom module for your CXF version and have a dependency on your application ?

                  • 6. Re: CXF problems while migrating to EAP 7
                    def321 Newbie

                    Thanks for your replies. But again:

                     

                    - I don't want to use jbossws. I'm happy it is disabled.

                    - I provide my own cxf jar within the EAR, it is there. The problem the log is reporting is that it cannot find "javax/xml/ws/Provider" (that's my guess). The provider class is in the JRE / JDK so I don't think I have to put it in the EAR

                    - I cannot create a custom module because I don't own the server. The application is send to multiple host with partly different application server (JBoss and WebSphere). Therefore all needed depedencies should be in the EAR. That's the reason I cannot use jbossws.