7 Replies Latest reply on Mar 2, 2010 5:05 AM by ropalka

    Occasional exceptions out of SOAPAddressingPropertiesImpl.writeHeaders

    adinn

      Hi guys,

       

      I am running an XTS demo on the current AS trunk and am occasionally seeing exceptions thrown from the soap stack:

       

      10:23:03,631 ERROR [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Exception during handler processing: javax.xml.ws.addressing.AddressingException: Cannot read ws-addressing headers
          at org.jboss.ws.extensions.addressing.soap.SOAPAddressingPropertiesImpl.writeHeaders(SOAPAddressingPropertiesImpl.java:317)
          at org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler.handleOutbound(WSAddressingClientHandler.java:116)
          at org.jboss.wsf.common.handler.GenericHandler.handleMessage(GenericHandler.java:53)
          at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:312)
          at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:145)
          at org.jboss.ws.core.jaxws.client.ClientImpl.callRequestHandlerChain(ClientImpl.java:178)
          at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:300)
          at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:299)
          at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
          at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
          at $Proxy216.completedOperation(Unknown Source)
          at com.arjuna.webservices11.wsba.client.ParticipantCompletionCoordinatorClient.sendCompleted(ParticipantCompletionCoordinatorClient.java:142)
          at com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCompleted(ParticipantCompletionParticipantEngine.java:809)
          at com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.commsTimeout(ParticipantCompletionParticipantEngine.java:760)
          at com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.access$000(ParticipantCompletionParticipantEngine.java:52)
          at com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine$1.run(ParticipantCompletionParticipantEngine.java:1254)
          at java.util.TimerThread.mainLoop(Timer.java:512)
          at java.util.TimerThread.run(Timer.java:462)
      Caused by: javax.xml.soap.SOAPException: Unable to create SOAP Factory: Unable to create SAAJ meta-factoryProvider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl could not be instantiated: java.lang.IllegalStateException: BaseClassLoader@144ee21{vfszip:/ssd/home/adinn/jboss/jbossas/trunk/build/target/jboss-6.0.0-SNAPSHOT/server/default/deploy/bademo.ear/} classLoader is not connected to a domain (probably undeployed?) for class com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl
          at javax.xml.soap.SOAPFactory.newInstance(SOAPFactory.java:270)
          at org.jboss.ws.extensions.addressing.soap.SOAPAddressingPropertiesImpl.writeHeaders(SOAPAddressingPropertiesImpl.java:225)
          ... 17 more


       

      The first exception tag 'Cannot read ws-addressing headers' is actually misleading since the root cause is the IllegalStateException occurring under the call to SOAPFactory.newInstance(). The thing is this problem does not seem to be stopping the XTS code from working -- I am presuming this is because the error is intermittent and the message gets through when XTS resends. Any idea what is causing the IllegalStateException?

       

      n.b. the error happens quite often, I would guess once every 2-3 times XTS dispatches a 'request' or 'response' (these are paired 1-way messages)  but I cannot guarantee to be able to reproduce it as yet. The demo in which it manifests is fairly complex -- AOP, EJB, Web Service + XTS BA :-( --  so I'm note sure yet how to isolate the problem. I just want to check if it is a known bug. If not I will investigate further.

        • 1. Re: Occasional exceptions out of SOAPAddressingPropertiesImpl.writeHeaders
          ropalka

          Hi Andrew,

           

             you need to have $JBOSS_HOME/lib/endorsed/jbossws-native-factories.jar on the classpath. It defines all the factories.

           

          Richard

          1 of 1 people found this helpful
          • 2. Re: Occasional exceptions out of SOAPAddressingPropertiesImpl.writeHeaders
            adinn

            Hi Richard,

             

            richard.opalka@jboss.com wrote:

             

               you need to have $JBOSS_HOME/lib/endorsed/jbossws-native-factories.jar on the classpath. It defines all the factories.


            That is on the classpath but it doesn't stop the problem.

             

            I just noticed  that this is happening after a hot depoy and the exception trace includes the following text

             

            com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl could not be instantiated: java.lang.IllegalStateException:
            BaseClassLoader@144ee21 classLoader is not connected to a domain (probably undeployed?) for class com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl

             

            So, this is probably to do with the undeploy/redeploy leaving something hanging on to the wrong version of a class. My app is deployed as an EAR containing i) a servlet in an embedded war, ii) an EJB exposed as a Web Servce in an embedded jar and iii) an AOP aspect classwhich transforms the EJB implementtaion class in another embedded '.aop' jar. I guess any of these could be responsible for the undployredeploy problem.

             

            Life is probably too short to worry about finding the culprit.

            • 3. Re: Occasional exceptions out of SOAPAddressingPropertiesImpl.writeHeaders
              frapaa

              Hi,

               

              Did you manage to solve this problem?

              I have a similar situation here; first deploy always succeeds, but after a redeploy the following exception prints out in the log:

               

              {code}

              org.mobicents.servlet.sip.core.dispatchers.DispatcherException:
              Unexpected exception while processing response : SIP/2.0 200 OK
                  at org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher$1.dispatch(ResponseDispatcher.java:314)
                  at org.mobicents.servlet.sip.core.dispatchers.DispatchTask.dispatchAndHandleExceptions(DispatchTask.java:55)
                  at org.mobicents.servlet.sip.core.dispatchers.DispatchTask.run(DispatchTask.java:50)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                  at java.lang.Thread.run(Thread.java:637)
              Caused by: javax.xml.parsers.FactoryConfigurationError: Provider com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl could not be instantiated: java.lang.IllegalStateException: BaseClassLoader@40be2b01{...} classLoader is not connected to a domain (probably undeployed?) for class com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
                  at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:129)
                  at org.apache.axis.utils.XMLUtils.getDOMFactory(XMLUtils.java:221)
                  at org.apache.axis.utils.XMLUtils.access$000(XMLUtils.java:75)
                  at org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder.initialValue(XMLUtils.java:98)
                  at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:141)
                  at java.lang.ThreadLocal.get(ThreadLocal.java:131)
                  at org.apache.axis.utils.XMLUtils.getDocumentBuilder(XMLUtils.java:237)
                  at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:337)
                  at org.apache.axis.message.SOAPDocumentImpl.<init>(SOAPDocumentImpl.java:70)
                  at org.apache.axis.SOAPPart.<init>(SOAPPart.java:1020)
                  at org.apache.axis.Message.setup(Message.java:377)
                  at org.apache.axis.Message.<init>(Message.java:246)

              {code}

               

              Any tips are appreciated!

               

              Thanks,

               

              Frank

              • 4. Re: Occasional exceptions out of SOAPAddressingPropertiesImpl.writeHeaders
                adinn

                frapaa wrote:

                 

                 

                Did you manage to solve this problem?


                 

                No. I didn't bother to do so. The error indicated that it was to do with an application classloader refusing to load classes correctly because the app had been undeployed. That implies that the problem relates to use of hot deployment. If the configuration I ran on was a stable production release it might merit the effort tracking down which class was hanging on to old rereferences.  I think there are far more important things to fix in the version I was using. If you rsituation is the former it might be worth pushing for someone to look at the problem. Of course, you could alwasy try to debug it yourself. We are always happy to be sent fixes :-)

                • 5. Re: Occasional exceptions out of SOAPAddressingPropertiesImpl.writeHeaders
                  frapaa

                  Thanks for the quick reply!

                   

                  I am running on JBoss 5.1.0 GA (bundled with Mobicents 1.2), but I don't know if I should start debugging that platform, hehe.. :-)

                   

                  Could the issue be that one of the classes in my application is holding on to a reference to this class that failed to undeploy/deploy?

                  • 6. Re: Occasional exceptions out of SOAPAddressingPropertiesImpl.writeHeaders
                    adinn

                    frapaa wrote:

                     

                    Thanks for the quick reply!

                     

                    I am running on JBoss 5.1.0 GA (bundled with Mobicents 1.2), but I don't know if I should start debugging that platform, hehe.. :-)

                     

                    Could the issue be that one of the classes in my application is holding on to a reference to this class that failed to undeploy/deploy?

                     

                    Well, 5.1.0.GA may be  worth trying to sort out. However,. hot deploy is a difficult thing to be get right because there are lots of places where something could be holding on to classes it should not be referring to -- that might be JBoss or it might be your code or it might be both. Whether the problem shows or not depends in part upon the order of classloading so probelms may linger for a while even when you think it is working.

                     

                    Are you deploying several artefacts and then only updating one? This can cause problems if you don't declare dependencies between your deployments. If there are dependencies then declare them so that the AS will undeploy the whole set.

                     

                    If not then you may have uncovered a bug in the AS or WS code. Since we don't offer any guarantees that hot deploy will work any problem you find will be a low priority for fixing -- hot deploy is merely a 'nice to have' for development, it's not somehting anyone should rely on in production. If you really want to find out what is wrong/fix it you'll need to rev up your debugger.

                    • 7. Re: Occasional exceptions out of SOAPAddressingPropertiesImpl.writeHeaders
                      ropalka
                      Thanks for pointing out this hot deploy issue Andrew. We will have a look.