2 Replies Latest reply on Jul 27, 2016 9:28 AM by Tomaz Cerar

    Exclude RESTeasy from deployment in JBoss EAP 6.4.9

    Peter Schmid Newbie

      Hello,

       

      I maintain a RESTful webservice as an EAR using Apache Wink 1.2.1 as the REST framework. This is due to the usage of some 3rd party libraries. I excluded RESTeasy from deployment using a jboss-deployment-structure.xml file with this content:

       

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

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

       

          <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

         

          <deployment>

              <exclude-subsystems>

                <subsystem name="jaxrs" />

                <subsystem name="resteasy" />

                <subsystem name="webservices" />

              </exclude-subsystems>

         

               <exclusions>

                  <module name="javax.ws.rs.api"/>

                  <module name="org.jboss.as.jaxrs"/>

                  <module name="org.jboss.resteasy.resteasy-atom-provider" />

                  <module name="org.jboss.resteasy.resteasy-cdi" />

                  <module name="org.jboss.resteasy.resteasy-jaxrs" />

                  <module name="org.jboss.resteasy.resteasy-jaxb-provider" />

                  <module name="org.jboss.resteasy.resteasy-jackson-provider" />

                  <module name="org.jboss.resteasy.resteasy-jsapi" />

                  <module name="org.jboss.resteasy.resteasy-multipart-provider" />

                  <module name="org.jboss.resteasy.async-http-servlet-30" />

                  <module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider" />

                  <module name="org.jboss.resteasy.resteasy-jettison-provider" />

                  <module name="org.jboss.resteasy.resteasy-spring" />

                  <module name="org.jboss.resteasy.resteasy-yaml-provider" />

                  <module name="org.codehaus.jackson.jackson-core-asl" />

                  <module name="org.codehaus.jackson.jackson-jaxrs" />

                  <module name="org.codehaus.jackson.jackson-mapper-asl" />

                  <module name="org.codehaus.jackson.jackson-xc" />

                  <module name="org.codehaus.jettison" />

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

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

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

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

                  <module name="org.jboss.ws.jaxws-client" />

                  <module name="org.jboss.ws.jaxws-jboss-httpserver-httpspi" />

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

                  <module name="org.jboss.ws.saaj-impl" />

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

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

                  <module name="javax.xml.bind.api" />

               </exclusions>

       

               <dependencies>

                  <!--

                      find com.sun.net.httpserver.HttpPrincipal out of jre/lib/rt.jar:

                      see http://stackoverflow.com/questions/12492717/jboss-7-1-1-add-rt-jar-of-jre-to-classpath

                   -->

                  <system export="true">

                      <paths>

                          <path name="com/sun/net/httpserver"/>

                      </paths>

                  </system>

                  <module name="com.oracle.ojdbc6" />

              </dependencies>

          </deployment>

      </jboss-deployment-structure>


      This workes fine with JBoss EAP 6.4.7 but fails with 6.4.9. Somehow JBoss' jboss-jaxrs-api_1.1_spec-1.0.1.Final-redhat-3.jar is interfering.


      When I commented the resource-root in JBOSS_HOME\modules\system\layers\base\javax\ws\rs\api\main\module.xml resulting in the module no longer being available to JBoss the deployment and also call to the webservice worked perfectly well.


      Since switching off jboss-jaxrs-api_1.1_spec-1.0.1.Final-redhat-3.jar completely is not an option, I need a way to exclude it from the webservice properly. Any help is highly appreciated.


      Thanks!

        • 1. Re: Exclude RESTeasy from deployment in JBoss EAP 6.4.9
          Peter Schmid Newbie

          Finally got it figured out! I had to adapt the jboss-deployment.structure.xml like this:

           

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

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

           

              <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

             

              <deployment>

                  <exclude-subsystems>

                    <subsystem name="jaxrs" />

                    <subsystem name="resteasy" />

                    <subsystem name="webservices" />

                  </exclude-subsystems>

             

                   <exclusions>

                      <module name="javaee.api" />

                      <module name="javax.ws.rs.api"/>

                      <module name="org.jboss.as.jaxrs"/>

                      <module name="org.jboss.resteasy.resteasy-atom-provider" />

                      <module name="org.jboss.resteasy.resteasy-cdi" />

                      <module name="org.jboss.resteasy.resteasy-jaxrs" />

                      <module name="org.jboss.resteasy.resteasy-jaxb-provider" />

                      <module name="org.jboss.resteasy.resteasy-jackson-provider" />

                      <module name="org.jboss.resteasy.resteasy-jsapi" />

                      <module name="org.jboss.resteasy.resteasy-multipart-provider" />

                      <module name="org.jboss.resteasy.async-http-servlet-30" />

                      <module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider" />

                      <module name="org.jboss.resteasy.resteasy-jettison-provider" />

                      <module name="org.jboss.resteasy.resteasy-spring" />

                      <module name="org.jboss.resteasy.resteasy-yaml-provider" />

                   </exclusions>

           

                   <dependencies>

                      <!--

                          find com.sun.net.httpserver.HttpPrincipal out of jre/lib/rt.jar:

                          see http://stackoverflow.com/questions/12492717/jboss-7-1-1-add-rt-jar-of-jre-to-classpath

                       -->

                      <system export="true">

                          <paths>

                              <path name="com/sun/net/httpserver"/>

                          </paths>

                      </system>

                      <module name="com.oracle.ojdbc6" />

                  </dependencies>

              </deployment>

             

              <sub-deployment name="MyWar.war" >

                   <exclusions>

                      <module name="javaee.api" />

                      <module name="javax.ws.rs.api"/>

                      <module name="org.jboss.as.jaxrs"/>

                      <module name="org.jboss.resteasy.resteasy-atom-provider" />

                      <module name="org.jboss.resteasy.resteasy-cdi" />

                      <module name="org.jboss.resteasy.resteasy-jaxrs" />

                      <module name="org.jboss.resteasy.resteasy-jaxb-provider" />

                      <module name="org.jboss.resteasy.resteasy-jackson-provider" />

                      <module name="org.jboss.resteasy.resteasy-jsapi" />

                      <module name="org.jboss.resteasy.resteasy-multipart-provider" />

                      <module name="org.jboss.resteasy.async-http-servlet-30" />

                      <module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider" />

                      <module name="org.jboss.resteasy.resteasy-jettison-provider" />

                      <module name="org.jboss.resteasy.resteasy-spring" />

                      <module name="org.jboss.resteasy.resteasy-yaml-provider" />

                   </exclusions>

              </sub-deployment>

           

          </jboss-deployment-structure>

           

          The changes include the following 2:

          1. Add javaee.api to the list of exclusions

          2. Add a sub-deployment section for the WAR included in my EAR, including the same exclusions

          • 2. Re: Exclude RESTeasy from deployment in JBoss EAP 6.4.9
            Tomaz Cerar Master

            You don't need so many exclusions.

             

            just having exclude extension stuff is enough. no need for modules as well.

            but you need to have them for sub deployments where you want to exclude them.

            top level exclude doesn't help here.