3 Replies Latest reply on Apr 30, 2010 9:28 AM by Alessio Soldano

    ClassCastException in javax.xml.soap.MessageFactory (saaj-api-1.3.jar) as a result of CMIS call to Alfresco 3.3 Community deployed into JBoss 4.2.3.GA.

    Boris Ovich Newbie

      My steps:

      1)Deployed Alfresco.war v3.3 on JBoss v4.2.3.GA as described at http://wiki.alfresco.com/wiki/Deploying_Alfresco_on_JBoss

      2) In addition corrected 'repository.properties' file inside the alfresco.war to locate all 3rd party apps.

      (see attached 'JBoss console output.txt' - it is clear from errors)

      3) Trying to make simple CMIS call (getRepositories) I have an error on the client side:

      ...

      Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog

      at [row,col {unknown-source}]: [1,0]

          at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)

      ...

      The cause of the error is response with *empty body* from Alfresco.

       

      4) Further investigation showed that this is Class Loader issue.

      Class org.jboss.ws.core.soap.MessageFactoryImpl (jboss-4.2.3.GA/server/default/tmp/deploy/tmp25575jbossws-core.jar), which is JBoss’ default implementation of the javax.xml.soap.MessageFactory (jboss-4.2.3.GA/server/default/deploy/alfresco.war/WEB-INF/lib/saaj-api-1.3.jar) cannot be classcasted to javax.xml.soap.MessageFactory.

      e.g.

      MessageFactory factory = (MessageFactory) instanceOfMessageFactoryImpl;   <-- result of ClassCastException

      This happens because the classes are loaded by classloaders, which are members of different branches of JBoss’ Classloaders hierarchy.

       

       

      Any ideas why it is happens? Is it either bug of JBoss or Alfresco or configuration issue?

       

      Any info is critical and highly appreciated.

        • 1. Re: ClassCastException in javax.xml.soap.MessageFactory (saaj-api-1.3.jar) as a result of CMIS call to Alfresco 3.3 Community deployed into JBoss 4.2.3.GA.
          Jim Ma Apprentice

          There is saaj jar  in jbossws native's implementation.  I think you do not need to package it in you war file.

          • 2. Re: ClassCastException in javax.xml.soap.MessageFactory (saaj-api-1.3.jar) as a result of CMIS call to Alfresco 3.3 Community deployed into JBoss 4.2.3.GA.
            Boris Ovich Newbie

            Unfortunately this didn't help much. Yes, the ClassCast has gone, but now I am hampered by org.jboss.util.NotImplementedException in org.jboss.ws.core.soap.SOAPPartImpl.appendChild(SOAPPartImpl.java:300):


            http-0.0.0.0-8080-1@9 daemon, priority=5, in group 'jboss', status: 'RUNNING'
                  at org.jboss.ws.core.soap.SOAPPartImpl.appendChild(SOAPPartImpl.java:300)
                  at org.apache.cxf.staxutils.W3CDOMStreamWriter.setChild(W3CDOMStreamWriter.java:114)
                  at org.apache.cxf.staxutils.W3CDOMStreamWriter.newChild(W3CDOMStreamWriter.java:104)
                  at org.apache.cxf.staxutils.W3CDOMStreamWriter.writeStartElement(W3CDOMStreamWriter.java:132)
                  at org.apache.cxf.staxutils.StaxUtils.writeStartElement(StaxUtils.java:447)
                  at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:391)
                  at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:379)
                  at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:361)
                  at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:108)
                  at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:68)
                  at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
                  at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
                  at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)
                  at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:368)
                  at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:183)
                  at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:163)
                  at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:141)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                  at java.lang.Thread.run(Thread.java:595)

             

            Comment is the source of the class mentions its version:

            // $Id: SOAPPartImpl.java 4081 2007-08-02 09:23:17Z thomas.diesler@jboss.com $

             

            Method which throws the exception:

            public org.w3c.dom.Node appendChild(org.w3c.dom.Node node) throws DOMException
               {
                  throw new NotImplementedException();
               }

            • 3. Re: ClassCastException in javax.xml.soap.MessageFactory (saaj-api-1.3.jar) as a result of CMIS call to Alfresco 3.3 Community deployed into JBoss 4.2.3.GA.
              Alessio Soldano Master

              Boris Ovich wrote:

               

              Unfortunately this didn't help much. Yes, the ClassCast has gone, but now I am hampered by org.jboss.util.NotImplementedException in org.jboss.ws.core.soap.SOAPPartImpl.appendChild(SOAPPartImpl.java:300):


              http-0.0.0.0-8080-1@9 daemon, priority=5, in group 'jboss', status: 'RUNNING'
                    at org.jboss.ws.core.soap.SOAPPartImpl.appendChild(SOAPPartImpl.java:300)
                    at org.apache.cxf.staxutils.W3CDOMStreamWriter.setChild(W3CDOMStreamWriter.java:114)
                    at org.apache.cxf.staxutils.W3CDOMStreamWriter.newChild(W3CDOMStreamWriter.java:104)
                    at org.apache.cxf.staxutils.W3CDOMStreamWriter.writeStartElement(W3CDOMStreamWriter.java:132)
                    at org.apache.cxf.staxutils.StaxUtils.writeStartElement(StaxUtils.java:447)
                    at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:391)
                    at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:379)
                    at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:361)
                    at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:108)
                    at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:68)
                    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
                    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
                    at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)
                    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:368)
                    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:183)
                    at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:163)
                    at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:141)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

              ...

               

              That's because CXF there tries to use a method not implemented in that version of JBossWS SAAJ implementation.

              You have multiple approaches here:

              - you try replacing the jbossws saaj library with a more recent one where that method has been implemented; I think you need https://jira.jboss.org/jira/browse/JBWS-2747, hence jbossws-3.2.1 is what you'd need. Unfortunately that requires JBoss AS 5.0 at least, so you'll probably end up trying if the saaj jar lib can be isolated and ported to AS 4.2.3 or you checkout the sources of the jbossws included in 4.2.3, fix SOAPPartImpl as done in the jira, compile and install the modified version to AS 4.2.3

              - you move to a more recent AS version, perhaps installing jbossws-cxf integration instead of deploying cxf on top of a JBoss AS that's running the jbossws-native stack