8 Replies Latest reply on May 13, 2016 7:39 AM by mgidwani-1

    Issue with Webservice project with Apache CXF deployed into Jboss EAP 6

    mail2kondeti

      I have WebService Endpoint Project(Service Project) built on Apache CXF and which is working fine when I tested with Tomcat and VMware Fabric Server(comes with Spring STS IDE). I could able run WSDLs up and running. But when I deploy the same project in Jboss 6, I am getting the following Error. Looks like JBoss got its own Implementation of CXF. So how to resolve the issue??? Something Configuration change that needs to be made?

      I tried this and didn't work either --> http://cxf.apache.org/docs/application-server-specific-configuration-guide.html#ApplicationServerSpecificConfigurationGuide-JBoss

       

      Looks like something causing an issue because JBoss got its own CXF Implementation(Highlighted in Yellow Color)… Need to see how to bypass that and gets from Apache CXF Implementation.

       

      16:10:15,847 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-7) Creating Service {urn:us:gov:treasury:irs:srv:acaformsubmissionstatus}SendACAFormSubmissionStatusDetailRequestService from WSDL: classpath:/wsdl/ACA_XML_LIB/SRV/ACAFormSubmissionStatus.wsdl

      16:10:16,602 INFO [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-7) Setting the server's publish address to be http://localhost:8080/myDomain/MyRequestService

      16:10:16,743 INFO [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (MSC service thread 1-7) WSDL published to: file:/C:/jboss-eap-6.0/standalone/data/wsdl/my-ear-ws-endpoint.ear/my-web-ws-endpoint-1.0.0-BUILD-SNAPSHOT.war/MyRequestService.wsdl

      16:10:16,786 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.subunit."my-ear-ws-endpoint.ear"."my-web-ws-endpoint-1.0.0-BUILD-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."my-ear-ws-endpoint.ear"."my-web-ws-endpoint-1.0.0-BUILD-SNAPSHOT.war".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "my-web-ws-endpoint-1.0.0-BUILD-SNAPSHOT.war" of deployment "my-ear-ws-endpoint.ear"

             at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]

             at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]

             at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]

             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]

             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]

             at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

      Caused by: java.lang.RuntimeException: Cannot publish wsdl to: C:\jboss-eap-6.0\standalone\data\wsdl\my-ear-ws-endpoint.ear\my-web-ws-endpoint-1.0.0-BUILD-SNAPSHOT.war\MyRequestService.wsdl

             at org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:107)

      at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.publishContractToFilesystem(EndpointImpl.java:222)

      at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:93)

      at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:239)

      at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:509)

             at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:117)

             at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:113)

             at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:66)

             at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)

             at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]

             ... 5 more

      Caused by: java.io.IOException: Could not find WEB-INF/wsdl/../MSG/SomeFile.xsd in the additional metadatafiles!

             at org.jboss.ws.common.deployment.ResourceResolverImpl.resolve(ResourceResolverImpl.java:124)

             at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:223)

             at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:249)

             at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:249)

             at org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:94)

             ... 14 more

       

      Could you please give me some thoughts on this? How to bypass or turn off JBoss CXF implementation in Jboss Server.

        • 1. Re: Issue with Webservice project with Apache CXF deployed into Jboss EAP 6
          asoldano

          JBoss Application Server (JBoss AS) comes with its own webservices stack (JBossWS) in order for providing full JavaEE support; that is currently internally based on Apache CXF. When willing to run Apache CXF based applications on top of JBoss AS 7 series, users have basically two options:

          • use JBoss AS as if it was a servlet container with no WS functionalities: this basically implies disabling the webservices subsystem for the user deployment, hence preventing the AS webservices stack from processing the ws endpoint deployment and letting the CXF libs included in the archive deal with any WS invocations when CXFServlet is hit; the webservices subsystem is turned off by adding a jboss-deployment-structure.xml as follows to the ws endpoint deployment:

             

            <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
                <deployment>
                    <exclude-subsystems>
                        <subsystem name="webservices" />
                    </exclude-subsystems>
                </deployment>
            </jboss-deployment-structure>
            
            

            this approach offers the fastest route to deploying CXF apps on JBoss AS; the drawback is that no special ws integration with JBoss AS internals is available

          • rely on JBossWS integration and the Apache CXF libraries included in the application server (documentation): this implies removing any Apache CXF libs from the ws deployment as well as any other dependencies which is already included in JBoss AS (including any Java EE API jar); if included, the optional web.xml descriptor is to be rewritten according to JBossWS convention (see documentation); the Spring support is optional in JBoss AS and Spring based endpoint declaration is not the default/preferred configuration approach for ws endpoints, hence users willing to declare endpoints using Spring needs to create a org.springframework.spring module and put their endpoint declarations in a jbossws-cxf.xml descriptor; if the user application makes use of any lib besides tha JavaEE api, proper module dependencies are to be declared either using the jboss-deployment-structure.xml descriptor or the archive MANIFEST.MF (few directions on ws modules available here)

          The second approach is the recomended one (and supported on EAP) and allows leveraging the full JavaEE 6 stack (including e.g. JSR-109) as well as specific ws integration with JBoss AS internals (full EJB3 endpoint support, JAAS integration, JBossWS configuration / management additions, CDI, etc.).

          • 2. Re: Issue with Webservice project with Apache CXF deployed into Jboss EAP 6
            mail2kondeti

            I found one information about this issue due to XSD imports in WSDL. There is an existing thread talk about this.

             

            https://community.jboss.org/thread/204976

             

            Alessio Soldano do you have any information on this? I really appreciate your response.

            • 3. Re: Issue with Webservice project with Apache CXF deployed into Jboss EAP 6
              asoldano

              The mentioned JBWS-3544 bug was fixed in JBossWS 4.1.0.Final.

              • 4. Re: Issue with Webservice project with Apache CXF deployed into Jboss EAP 6
                mail2kondeti

                Dear Alessio Soldano Looks like your reply and mine were on the same time. THANK YOU very much for your response on this Question. I have tried as per the Apache CXF recommendation for JBoss and didn't work the option. Here is the Info.

                 

                http://cxf.apache.org/docs/application-server-specific-configuration-guide.html#ApplicationServerSpecificConfigurationGuide-JBoss

                 

                Good to hear that XSD import issue got fixed. However what would be the root cause of this issue? I have got all my XML Library files(WSDL and XSD with different directories) deployed under -->

                C:\jboss-eap-6.0\standalone\deployments\my-ear-ws-endpoint.ear\my-web-ws-endpoint-1.0.0-BUILD-SNAPSHOT.war\XML_LIB\SRV (wsdl files)  and ..\XML_LIB\MSG(xsd files).

                 

                But why would Jboss is expecting files(XSDs) under --> C:\jboss-eap-6.0\standalone\data\wsdl\my-ear-ws-endpoint.ear\MSG ???

                 

                When I copy manuallly [SomeFile.xsd]under the above path, this error is not coming up.

                 

                Caused by: java.io.IOException: Could not find WEB-INF/wsdl/../MSG/SomeFile.xsd in the additional metadatafiles!

                       at org.jboss.ws.common.deployment.ResourceResolverImpl.resolve(ResourceResolverImpl.java:124)

                       at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:223)

                       at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:249)

                       at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:249)

                       at org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:94)

                       ... 14 more

                 


                 

                 

                When I run my endpoint project on Tomcat, I do NOT see any issues like this? Appreciate your help over here.

                • 5. Re: Issue with Webservice project with Apache CXF deployed into Jboss EAP 6
                  mail2kondeti

                  Alessio Soldano - I have tried with the option-1 by adding jboss-deployment-descriptor.xml file under WEB-INF directory to bypass Jboss WS and it didn't work. It might be due to the server which I am using as JBoss EAP 6.0

                  Could you please elaborate the option-2?? I am newbie to JBoss world and I don't have any Jboss related configurations files in my current project. What kind of files that we neede for JBoss deployment and where it can be placed(under folder structure) like under WEB-INF or resources directory?

                  • 6. Re: Issue with Webservice project with Apache CXF deployed into Jboss EAP 6
                    mail2kondeti

                    WOW!!! This issue got resolved.

                     

                    To avoid JBoss WS stack in JBoss EAP6.0, you need to following config changes.

                     

                    Comment these two sections below in standalone.xml & domain.xml [JBOSS_HOME/standalone/configuration |  JBOSS_HOME/domain/configuration]

                     

                        ....

                        <extension module="org.jboss.as.threads"/>

                        <extension module="org.jboss.as.transactions"/>

                        <extension module="org.jboss.as.web"/>

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

                        <extension module="org.jboss.as.weld"/>

                        ....

                     

                    <!--

                        <subsystem xmlns="urn:jboss:domain:webservices:1.1">

                    <modify-wsdl-address>true</modify-wsdl-address>

                    <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>

                          <endpoint-config name="Standard-Endpoint-Config"/>

                          <endpoint-config name="Recording-Endpoint-Config">

                    <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">

                    <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>

                    </pre-handler-chain>

                          </endpoint-config>

                        </subsystem>

                    -->

                     

                    Once you make these changes, you are good to go. It will bypass JBoss WS and take your Apache CXF mappings.

                     

                    Best of luck

                    • 7. Re: Issue with Webservice project with Apache CXF deployed into Jboss EAP 6
                      asoldano

                      Just FYI, what you did is completely disabling the webservices subsystem on the server. That is equivalent to having the jboss-deployment-structure.xml descriptor mentioned above in any deployment.

                      Btw, some doc on this available at https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7

                      • 8. Re: Issue with Webservice project with Apache CXF deployed into Jboss EAP 6
                        mgidwani-1

                        Hi asoldano,

                        While migrating application from JBoss AS7 to WildFly9 I got following exception :

                        ."diamond-ws.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."diamond.ear"."diamond-ws.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "diamond-ws.war" of deployment "diamond.ear"

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

                                       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:1145)

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

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

                        Caused by: org.jboss.wsf.spi.WSFException: WFLYWS0066: Servlet class org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet declared in web.xml; either provide a proper deployment relying on JBossWS 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.

                                       at org.jboss.as.webservices.tomcat.WebMetaDataModifier.configureEndpoints(WebMetaDataModifier.java:98)

                                       at org.jboss.as.webservices.tomcat.WebMetaDataModifier.modify(WebMetaDataModifier.java:63)

                                       at org.jboss.as.webservices.tomcat.WebMetaDataModifyingDeploymentAspect.start(WebMetaDataModifyingDeploymentAspect.java:38)

                                       at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:73)

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

                                       ... 5 more


                        Snippet from web.xml is as follows:

                        <servlet>

                          <servlet-name>CXFServlet</servlet-name>

                          <display-name>CXF Servlet</display-name>

                          <servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>

                          <init-param>

                          <param-name>javax.ws.rs.Application</param-name>

                          <param-value>

                          com.perotsystems.diamond.ws.rs.DiamondRESTWebServiceConfig      

                          </param-value>

                          </init-param>

                          <init-param>

                          <param-name>jaxrs.properties</param-name>

                          <param-value>

                          check.parameter.handlers.first=true attachment-directory=/tmp attachment-memory-threshold=404800 attachment-max-size=404800

                          </param-value>

                          </init-param>

                          </servlet>

                         

                          <servlet-mapping>

                          <servlet-name>CXFServlet</servlet-name>

                          <url-pattern>/rest/*</url-pattern>

                          </servlet-mapping>

                         

                        I would like to use JBossWS instead of external CxF. By the way I also tried disabling webservices feature by commenting webservices extension module and subsystem as described above and that also didn't work. Could you please advise the way out?


                        Thanks!!