3 Replies Latest reply on May 21, 2014 12:48 PM by Fernando Luna

    ClassNotFoundException: com.sun.org.apache.xerces.internal.dom.DocumentImpl - JBoss-as-7.1.0.Final

    Shameer Kunjumohamed Newbie

      When trying to invoke a spring web services deployed in a JBoss-as-7.1.0.Final, I am getting the following error.

       

       

      Failed to define class com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl in Module "deployment.Martrust.ear.MartrustWebServices-0.0.1-SNAPSHOT.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl (Module "deployment.Martrust.ear.MartrustWebServices-0.0.1-SNAPSHOT.war:main" from Service Module Loader)                  at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)                                                            


      at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)                                                         

      at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)                                                        

      at org.jboss.modules.Module.loadModuleClass(Module.java:517)                                                                              

      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)                                                              

      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)                                      

      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)                                        

      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)                                               

      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)                                                      

      at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.<init>(SOAPPartImpl.java:88) [saaj-impl-1.3.jar:1.3]                                      

      at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.<init>(SOAPPart1_1Impl.java:58) [saaj-impl-1.3.jar:1.3]                         

      at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:78) [saaj-impl-1.3.jar:1.3]                      

      at com.sun.xml.messaging.saaj.soap.MessageImpl.initCharsetProperty(MessageImpl.java:1304) [saaj-impl-1.3.jar:1.3]                         

      at com.sun.xml.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:363) [saaj-impl-1.3.jar:1.3]                                         

      at com.sun.xml.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:273) [saaj-impl-1.3.jar:1.3]                                       

      at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.<init>(Message1_1Impl.java:68) [saaj-impl-1.3.jar:1.3]                           

      at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:62) [saaj-impl-1.3.jar:1.3]  

      at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:184) [spring-ws-core-2.0.4.RELEASE.jar:]                                                                                                                                          

      at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:60) [spring-ws-core-2.0.4.RELEASE.jar:]                                                                                                                                           

      at org.springframework.ws.transport.AbstractWebServiceConnection.receive(AbstractWebServiceConnection.java:90) [spring-ws-core-2.0.4.RELEASE.jar:]                                                                                                                                               

      at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:86) [spring-ws-core-2.0.4.RELEASE.jar:]                                                                                                          

      at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:59) [spring-ws-core-2.0.4.RELEASE.jar:]                                                                                                                     

      at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:221) [spring-ws-core-2.0.4.RELEASE.jar:]                                                                                                                                               

      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) [spring-webmvc-3.1.0.RELEASE.jar:3.1.0.RELEASE] 

      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) [spring-webmvc-3.1.0.RELEASE.jar:3.1.0.RELEASE]     

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]                  

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]                  

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]         

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]                 

      at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]                                                                                                                                        

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]         

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]                 

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]                       

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]                       

      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]                                                                                                                                         

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]                             

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]                             

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]                         

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]                               

      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]                                

      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]          

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]                                   

      at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]                                                                                

      Caused by: java.lang.NoClassDefFoundError: com/sun/org/apache/xerces/internal/dom/DocumentImpl                                                        

      at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_03]                                                                    



      at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_03]                                                              

      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_03]                                              

      at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)                                                    

      at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)                                                            

      ... 42 more                                                                                                                               
      Caused by: java.lang.ClassNotFoundException: com.sun.org.apache.xerces.internal.dom.DocumentImpl from [Module "deployment.Martrust.ear.MartrustWebServices-0.0.1-SNAPSHOT.war:main" from Service Module Loader]                                                                                               at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)                                                              


      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)                                      

      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)                                        

      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)                                               

      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)                                                      

      ... 47 more

       

      Here are the maven dependencies

       

        <dependencies>
          <dependency>
            <groupId>org.springframework.ws</groupId>
            <artifactId>spring-ws-core</artifactId>
            <version>2.0.4.RELEASE</version>
          </dependency>
           <dependency>
              <groupId>com.sun.xml.messaging.saaj</groupId>
              <artifactId>saaj-impl</artifactId>
              <version>1.3</version>
            </dependency>
            <dependency>
              <groupId>javax.xml.soap</groupId>
              <artifactId>saaj-api</artifactId>
              <version>1.3</version>
              <scope>import</scope>
           </dependency>
      
      </dependencies>
      
      
      

      If I remove Saaj dependencies from here, it throws the class-not-found-exceptions for saaj classes.

       

      I have seen similar error reported on thread, Failed to define class com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl, but found those changes suggested are already implemented in JBoss 7.1.0.Final.

       

      Any one has a clue about how this could be resolved ?

       

      Thanks,

      Shameer