1 2 3 Previous Next 36 Replies Latest reply on Mar 28, 2014 1:06 PM by ctomc

    How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.

    sboscarine

      Hello All,

      I am porting an application from JBoss EAP 4.3 to EAP 6.0 and am running into an issue because our legacy application bootstraps Apache CXF through Spring to expose services using JAX-RS & JAX-WS.

       

      On EAP6, the container is trying to process the annotations and is running into errors because it doesn't know what to do with my Spring dependencies. 

       

      I am deploying this application in an ear and would like to disable JAX-RS and JAX-WS for just that ear.  I'd like to port the services to Java EE 6 as time allows, so the new EE6 CD+JAX-RS/WS services will need to co-exist in the same container, but a different war. 

       

      I tried doing:

       

        <!-- Disable built-in EAP6 JAX-RS Annotation Processing -->
        <context-param>
          <param-name>resteasy.scan</param-name>
          <param-value>false</param-value>
        </context-param>
        <context-param>
          <param-name>resteasy.scan.providers</param-name>
          <param-value>false</param-value>
        </context-param>
        <context-param>
          <param-name>resteasy.scan.resources</param-name>
          <param-value>false</param-value>
        </context-param>
      

       

      but it still tries to process the services, each annotated with JAX-WS and JAX-RS.  Perhaps I need something to disable JAX-WS?

       

      Any other options?

       

      Thanks in advance!

        • 1. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
          nickarls

          https://access.redhat.com/knowledge/docs/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/Exclude_a_Subsystem_from_a_Deployment.html

           

          speaks on how to disable a subsystem from a deployment but I'm not sure from which version on this applies.

          • 2. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
            sboscarine

            I tried that guide and had issues.  From the guide:    

            <?xml version="1.0" encoding="UTF-8"?>
            <jboss-deployment-structure>
                <deployment>
                    <exclude-subsystems>
                        <subsystem name="jaxrs" />
                    </exclude-subsystems>
                </deployment>
            </jboss-deployment-structure>
            

             

            ...fails with:

             

            Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[4,9]
            Message: JBAS018754: Unexpected content of type 'element start', name is 'exclude-subsystems', text is: 'null'
                at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.unexpectedContent(JBossDeploymentStructureParser11.java:1092) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
                at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.parseModuleStructureSpec(JBossDeploymentStructureParser11.java:334) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
                at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.parseDeployment(JBossDeploymentStructureParser11.java:235) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
                at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:212) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
                at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:43) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
                at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
                at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
                at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:294) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
                ... 8 more
            

             

            This is saving it in EAR_ROOT/META-INF/jboss-deployment-structure.xml  I think the location/file-name are correct because:

             

            <?xml version="1.0" encoding="UTF-8"?>
            <jboss-deployment-structure>
              <deployment>
                <dependencies>
                  <!-- Expose JCA Adapter to get to oracle.jdbc.OracleConnection from java.sql.Connection -->
                  <module name="org.jboss.ironjacamar.jdbcadapters" export="true" />
                  <!-- Expose Global JDBC Driver we installed to get to oracle.jdbc.OracleConnection class itself -->
                  <module name="com.oracle.jdbc" export="true" />
                </dependencies>
              </deployment>
            

             

            ...works and exposes the  classes needed.

            • 3. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
              ctomc

              Hi,

               

              support for excluding whole subsystem was added with jboss-deployment-description schema 1.2 which is present in all versions since 7.1.2 and up.

              so in short that is not part of 7.1.1.Final

              but you build 7.1.2/7.1.3 tag or take nightly build.

               

               

              --

              tomaz

              1 of 1 people found this helpful
              • 4. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                sboscarine

                Hmm, I see EAP 6.0.1 was released yesterday.  I've been doing this on EAP 6.0.0.  I'll give the latest version a try.

                • 5. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                  sboscarine

                  Tried on JBoss EAP 6.0.1 and got:

                   

                  Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018748: Error loading jboss-deployment-structure.xml from C:\tools\jboss-eap-6.0\bin\..\standalone\tmp\vfs\temp12c550a4a136ea03\content-c71a8984b9ae344e\contents\META-INF\jboss-deployment-structure.xml
                      at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:300) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:272) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:138) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      ... 5 more
                  Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[4,5]
                  Message: JBAS018754: Unexpected content of type 'element start', name is 'exclude-subsystems', text is: 'null'
                      at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.unexpectedContent(JBossDeploymentStructureParser11.java:1092) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.parseModuleStructureSpec(JBossDeploymentStructureParser11.java:334) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.parseDeployment(JBossDeploymentStructureParser11.java:235) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:212) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:43) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
                      at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
                      at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:294) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
                      ... 8 more
                  

                   

                  with:

                   

                  <?xml version="1.0" encoding="UTF-8"?>
                  <jboss-deployment-structure>
                    <deployment>
                      <exclude-subsystems>
                        <subsystem name="jaxrs" />
                      </exclude-subsystems>
                    </deployment>
                  </jboss-deployment-structure>
                  
                  • 6. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                    ctomc

                    hi,

                     

                    like that it won't work you need to specify xsd version to use

                    try with this:

                    <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

                        <deployment>

                            <exclude-subsystems>

                                <subsystem name="jaxrs" />

                            </exclude-subsystems>

                        </deployment>

                    </jboss-deployment-structure>

                     

                    --

                    tomaz

                    1 of 1 people found this helpful
                    • 7. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                      sboscarine

                      Thanks again, Tomaz!

                       

                      I was able to disable JAX-WS and JAX-RS for my ear in EAP 6.0.1 with:

                       

                      <?xml version="1.0" encoding="UTF-8"?>
                      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
                        <deployment>
                          <exclude-subsystems>
                            <subsystem name="jaxrs" />
                            <subsystem name="webservices" />
                          </exclude-subsystems>
                        </deployment>
                      </jboss-deployment-structure>
                      

                       

                      It looks like the two help pages https://access.redhat.com/knowledge/docs/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/Exclude_a_Subsystem_from_a_Deployment.html and https://access.redhat.com/knowledge/solutions/107983 are incorrect.

                       

                      If anyone else has this issue, I found it helpful to disable JAX-WS at the EAR level using the jboss-deployment-structure.xml above and JAX-RS at the war-level using the context params in web.xml posted above.  Disabling at web.xml allows us to let our old war use legacy CXF JAX-RS wired in Spring and we're planning on writing our new code in Java EE6 in a new war.

                      • 8. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                        ctomc

                        Hi,

                         

                        I have created https://issues.jboss.org/browse/AS7-6228 to fix the behavior for which parser should be used if no namespace is specifed.

                        and also notifed that guys that mentain docs.

                         

                        thanks for feedback

                         

                         

                         

                        --

                        tomaz

                        • 9. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                          aherrao.sachin

                          Hi Tomaz,

                          I want to disable the container's JAX-WS from within my war file.

                          I have JBOSS 7.1.0 final.

                          I tried putting following code in jboss-deployment-structure.xml

                           

                          <exclude-subsystems>

                                      <subsystem name="jaxrs" />

                                      <subsystem name="webservices" />

                          </exclude-subsystems>

                           

                          Still it is not working.

                           

                          I am getting following exception

                           

                          11:21:50,735 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."eQube69.war".STRUCTURE: org.jboss.msc.service.StartException in servic

                          e jboss.deployment.unit."eQube69.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "eQube69.war"

                                  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

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

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

                                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_04]

                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_04]

                                  at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_04]

                           

                          Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Error loading jboss-structure.xml from D:\App Servers\jboss-as-7.1.0.Final\standalone\deployments\eQube69.war\WEB-INF\jboss-deployment-structure.xml

                                  at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:275) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                                  at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:247) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                                  at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:133) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                                  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                                  ... 5 more

                           

                          Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]

                          Message: Unexpected element '{urn:jboss:deployment-structure:1.2}jboss-deployment-structure'

                                  at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:108)

                                  at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)

                                  at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:269) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                                  ... 8 more

                           

                          Following is the content of jboss-deployment-structure.xml

                           

                          <?xml version="1.0" encoding="UTF-8"?>

                          <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

                              <deployment>

                                  <exclude-subsystems>

                                      <subsystem name="jaxrs" />

                                      <subsystem name="webservices" />

                                  </exclude-subsystems>

                                  <exclusions>

                                      <module name="org.apache.log4j" />

                                      <module name="org.jboss.as.webservices.*" />

                                      <module name="org.jboss.ws.*" />

                                  </exclusions>

                                  <dependencies>

                                      <module name="org.bouncycastle" slot="main" export="true"/>

                                  </dependencies>

                              </deployment>

                          </jboss-deployment-structure>

                           

                          Any help will be greatly appreciated. Thankx in advance.

                          • 10. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                            nickarls

                            It's only available in 7.1.2+

                            • 11. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                              aherrao.sachin

                              Hi Nicklas.

                              First of all thank you very much for your quick reply.

                              I tried to download JBOSS 7.1.2 from official JBOSS website

                              http://www.jboss.org/jbossas/downloads/

                               

                              But according to that web page latest version of JBOSS available is 7.1.1 final.

                              So how can I get JBOSS 7.1.2+

                              Can u provide me url from where I can download JBOSS 7.1.2.

                               

                              Thankx in advance.

                              • 12. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                                nickarls

                                The latest community (downloadable) release is 7.1.1. You can downloaded the sources for 7.1.2 or 7.1.3 from https://github.com/jbossas/jboss-as/tags and build it yourself.

                                • 13. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                                  aherrao.sachin

                                  Hi Nicklas,

                                  Thankx again for your reply.

                                   

                                  JBOSS 7.1.2 is it released or not?

                                   

                                  If it is relaesed then why it is not there in JBOSS official website?

                                   

                                  If it is not released then

                                  1) It wont do in my case as in my requirement specifications I have to make it work on 7.1.0 (or atleast I can tell them that this works on JBOSS 7.1.2 and 7.1.2 is released)

                                  2) Can u tell me the expected release date for JBOSS 7.1.2?

                                  3) Is there any work around to make it work on 7.1.0 final.

                                   

                                  It will be better for me if you can give me work around on 7.1.0 final

                                   

                                  Thankx

                                  • 14. Re: How do I disable the container's JAX-RS and JAX-WS in a war? - need to deploy legacy JAX-WS/RS application.
                                    nickarls

                                    7.1.1 is the latest community release (downloadable)

                                    7.1.2, 7.1.3 (and 7.1.4 when it's done) are releases used in the EAP (commercial) scenarios. The base versions for these can still be built from sources

                                    7.2.0 will be the next community release (when it's done)

                                     

                                    As for workarounds without subsystem exclusions, you'll have to google around.

                                    1 2 3 Previous Next