4 Replies Latest reply on Aug 30, 2012 9:29 PM by Mike P

    Metro on JBoss

    jackbauer42 Newbie

      Hello Everyone.  I'm currently working to get a web service deployment that relies on Metro deployed to JBoss 7.  I have removed the JBoss WS references from my standalone configuration (brings in CXF by default) and that didn't cause any issues.  I'm using the JAX-WS 2.2 API which is already available as a JBoss module.  Deployment starts okay but then fails when it attempts to create the SAAJMetaFactoryImpl:

       

      {code}

      Caused by: javax.xml.soap.SOAPException: Unable to create SAAJ meta-factoryProvider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found

                at javax.xml.soap.SAAJMetaFactory.getInstance(Unknown Source) [jboss-saaj-api_1.3_spec-1.0.1.Final.jar:1.0.1.Final]

                at javax.xml.soap.MessageFactory.newInstance(Unknown Source) [jboss-saaj-api_1.3_spec-1.0.1.Final.jar:1.0.1.Final]

                at com.sun.xml.ws.api.SOAPVersion.<init>(SOAPVersion.java:176) [webservices-rt-2.0.1.jar:1.0]

      {code}

       

       

      The class that can't be found is available in the Java 6 JRE.  I'm not sure why JBoss is loading the jboss-saaj-api module even though I've not included JBoss WS as an extension within my startup configuration.  The jboss saaj module tries to load a different class than what is provided by the JRE.  Why can't the WAR's classloader see the SAAJ classes provided by the JRE?  Is it possible to make JRE 6 classes available (will interfere with many of the javaee apis but perhaps it can be filtered)? I have tried to add the jboss-deployment-structure.xml to my application; defining a module exclusion for the SAAJ-API which has proved to be unsuccessful.

       

      {code:xml}

      <exclusions>

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

      </exclusions>

      {code}

       

       

      In the past, all issues that look like this have boiled down to classloading issues.  From what I can tell, I haven't included any APIs within the WAR that should conflict with the JRE or JBoss provided APIs.  Any pointers or suggestions would be much appreciated.

       

      Thanks.

        • 1. Re: Metro on JBoss
          Richard Opalka Master

          Hi,

           

             in order to proceed you'll need to remove

           

          <module name="org.jboss.modules"/>

           

          declaration from both

           

          * modules/javax/xml/soap/api/main/module.xml

          * modules/javax/xml/ws/api/main/module.xml

           

          The reason is these API jars contain some classloading hacks that are trying to lookup JBossAS specific JAXWS & SAAJ impls.

          If you'll remove this org.jboss.modules dependency, the hack will become disabled.

           

          Next U'll need to extend

           

          * modules/sun/jdk/main/module.xml

           

          to include Sun RI JAXWS & SAAJ impl packages, plus define SAAJ Sun RI services & JAXWS Sun RI services in

           

          sun/jdk/main/service-loader-resources/META-INF/services

           

          folder.

           

          Finally U'll need to add

           

          <module name="sun.jdk"/>

           

          dependency to both

           

          * modules/javax/xml/soap/api/main/module.xml

          * modules/javax/xml/ws/api/main/module.xml

           

          This way Sun RI impl classes should be used from any deployment that is depending on these modules.

          • 2. Re: Metro on JBoss
            Alessio Soldano Master

            If the goal here is to use a given SAAJ meta factory without changing the global AS behaviour, you should probably start by trying setting the javax.soap.MetaFactory service in your deployment's META-INF/services . AFAIK, the jboss-saaj-api.jar basically adds a fallback mechanism for getting a given implementation from one of the AS7 modules. So you should be able to override that by specifying the factory you want to use.

            • 3. Re: Metro on JBoss
              Vaughn Butt Newbie

              Hi,

               

              I'm hoping to be able to use these instructions to get Metro working on AS 7.

               

              But there are a couple of things about the Sun RI JAXWS & SAAJ impl packages that I am not clear on.

               

              1. Which packages are the Sun RI JAXWS packages? If I understand correctly, the API is included in the JRE libraries (javax.xml.ws) but the RI is in a separate downloadable library (http://jax-ws.java.net/). If so, then wouldn't we instead add the Sun RI JAXWS as another module?
              2. What needs to be done to define SAAJ Sun RI services & JAXWS Sun RI services?

               

              Thanks.

              VB

              • 4. Re: Metro on JBoss
                Mike P Newbie

                Hi Vaughn, I'm also stuck on this. I've started a new topic on this: https://community.jboss.org/thread/204752