3 Replies Latest reply on Oct 12, 2004 1:53 PM by thomas.diesler

    need war to override Axis jar

    mazz

      I'm having a problem deploying a WAR that contains Axis and some web services.

      I have a war that works fine when deployed in a simple Tomcat install. This war has Axis 1.2 RC1 in it and my set of web services, along with Apache's WS-Addressing library. I need Axis RC1 because WS-Addressing jar has a dependency on a class in the new Axis (i.e. WS-Addressing fails to run with Axis 1.2beta2 or less - throws a NoSuchMethodError due to missing constructor that is only found in Axis 1.2 RC1).

      When I deploy in JBoss 4.0, I get that same NoSuchMethodError, due to the unified classloader picking up JBoss's Axis (1.2beta2) and not the one in my war's WEB-INF/lib.

      I tried turning off that unified classloader using tips I found here in the Forum and the Wiki. But to no avail. Here's what I put in my war's WEB-INF/jboss-web.xml:

      <jboss-web>
       <class-loading java2ClassLoadingCompliance="false">
       <loader-repository>
       dot.com:loader=wsdm.war
       <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
       </loader-repository>
       </class-loading>
      </jboss-web>
      


      I tried the different combinations for the above settings (false/true, true/false, etc) - all still fail.

      The only thing that I have been able to do to get it to work is to replace the axis-ws4ee.jar file in the jboss-ws4ee.sar with my Axis RC1 jar. When I do that, all worked fine. So I assume this all points to a class loading issue, but I can't find the magic bits to get it to work (without having to play with JBoss's own internal axis-wsee SAR). I would like to be able to deploy my own WAR and have it isolated without affecting JBoss's internals or other deployments that may rely on the Axis that comes with JBoss.

      Any hints/tips are appreciated.


        • 1. Re: need war to override Axis jar
          thomas.diesler

          When you want to run on Axis instead of JBossWS you need to undeploy jboss-ws4ee.sar. The last time I looked, Axis was holding static references to classloaders, which do not play well with the notion of LoaderRepositories and redeployment in general.

          • 2. Re: need war to override Axis jar
            mazz

            Thanks Thomas. That worked for me. Just ensuring that the WS4EE SAR isn't deployed allowed me to deploy my WAR (I don't even need the jboss-web.xml when I do this - all defaults seem to work out fine).

            Can I assume that this WS4EE SAR is used only to deploy web services as per JSR-109 (aka the J2EE-way)? In other words, can I assume that if I just want to deploy Axis myself in my own WAR that I won't need the WS4EE SAR functionality for anything?

            • 3. Re: need war to override Axis jar
              thomas.diesler

              Correct, when you undeploy JBossWS will no longer have support for deployments J2EE compatible web service endpoints and clients.

              Also make sure, you remove the jaxrpc related jars from $JBOSS_HOME/client and use the JWSDP client jars instead.