4 Replies Latest reply on Jun 9, 2011 12:15 PM by valbou

    getSoapHeader "crashes" in a JAR

    valbou

      Hello,

       

      I've created a web service using the Eclipse generation tool and also implemented a handler, using a JBOSS 5.1 server.

       

      Everything works if the web service is in a WAR. However, I'd like it to be in a JAR used by a WAR (so that the JAR will be more easily used by other WARs). Of course, the WAR has a dependency on the JAR and my web service class is declared as a servlet in the web.xml of the WAR. The client side works but on the server side, the handleInbound(MessageContext msgContext) method of the handler crashes on the instruction : msg.getSOAPHeader(); where msg is a variable I got thanks to SOAPMessage msg = ((SOAPMessageContext) msgContext).getMessage();

       

      When I say it crashes, I don't really know what's going on in fact since there is no exception. The msg variable is not empty and when I inspect msg.getSOAPHeader(), it displays "org.jboss.ws.core.soap.SOAPHeaderImpl@e9c517[[env:Header: null]]"  (the null is not abnormal: it returns the same result when my web service is in a WAR). Until here, no problem identified.

       

      Then a debug "Step Into" makes it stop but not really : the client servlet is always waiting for the response and it finally displays an out of memory after some minutes.

       

      It is weird. What could explain a such behaviour ?

       

      Thanks,

      Val Bou.

        • 1. Re: getSoapHeader "crashes" in a JAR
          regis.ramillien

          A little bit more informations.

           

          It seems that the class loader does not find the org.jboss.ws.core.soap.SOAPHeaderImpl class when the code is in a JAR file deployed in the webapp.

          When code is directly in a class of the web app, the class loader find the SOAPHeaderImpl...

           

          Another strange thing is that we do not have ClassNotFoundException or NoClassDefFoundError. The app "seems" to search for the class and memory grow slowly until crashing.

           

          A last information, when searching for the class, we have found it under the jboss-5.1.0.GA\client folder in the jbossws-native-core.jar file.

          So can it be possible that a class in the webapp is able to get the library that comes from the client folder of the server ? And not a JAR in this same webapp ?

           

          Do we have a design issue ?

           

          Another thing ?

           

          Thanks a lot for your help !

          • 2. Re: getSoapHeader "crashes" in a JAR
            valbou

            Concerning SOAPHeaderImpl, I added the bossws-native-core.jar directly in the JAR and it doesn't change anything. Also tried to put it in the WEB-INF of the WAR but no more result...

            • 3. Re: getSoapHeader "crashes" in a JAR
              valbou

              I finally added the web service classes directly in the war but I still have the same problem.

               

              Is there a WAR configuration that could fix that ?

              • 4. Re: getSoapHeader "crashes" in a JAR
                valbou

                The problem is fixed. It was coming from dependancies with other projects, leading to conflicts.