2 Replies Latest reply on Jul 29, 2009 1:59 PM by Ha Wa

    JBoss 5 NoClassDefFoundError & Other Exceptions

    Ha Wa Newbie

      I'm new at JBoss 5 and I've been stuck on this problem for a week and could really use (and appreciate) any help I can get.

      I'm using JBoss 5.1.0 GA and I've tried JBoss 5 jdk5 version with JDK 5 and JBoss 5 jdk version with JDK 6 and have gotten the same results. I'm also using EJB3 with GWT and jBPM.

      My ear application deploys perfectly on JBoss 4.2.3GA but not on JBoss 5. It keeps on complaining that usual Java classes, like org.w3c.dom.Document cannot be found. There's also a warning about the ClassLoader and I'm not sure if that's related.

      First of all, are these warning normal? Or is something already wrong when I start the JBoss 5 server. And how do I fix these warnings?

      18:16:20,791 WARN [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks
      messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
      18:16:20,791 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent
      18:16:20,947 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent
      


      Then when I deploy the EAR that works on JBoss 4, it gives me these different exceptions (depending on the scenario) in JBoss 5...

      This exception occurs if I hit CTRL-C because nothing is happening:
      16:34:46,498 ERROR [[/pocgwt]] Exception while dispatching incoming RPC call
      com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String[] com.bioimagene.poc.client.Poc.getAllCases()' th
      rew an unexpected exception: java.lang.NoClassDefFoundError: org/w3c/dom/Document
       at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
       at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
       at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
       at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       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:235)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
       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:158)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/Document
       at com.bioimagene.poc.server.CaseUser.<init>(CaseUser.java:34)
       at com.bioimagene.poc.server.App.getAllCases(App.java:59)
       at com.bioimagene.poc.server.PocImpl.getAllCases(PocImpl.java:34)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
       ... 24 more
      Caused by: java.lang.ClassNotFoundException: Failed to load class org.w3c.dom.Document
       at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:170)
       at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:265)
       at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1119)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:798)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:441)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       ... 32 more
      


      This error occurs if I *don't* hit CTRL-C and let it run overnight:
      19:57:05,067 ERROR [STDERR] Exception in thread "AOPListner"
      19:57:05,067 ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space
      19:57:08,395 ERROR [STDERR] at java.util.WeakHashMap.put(WeakHashMap.java:416)
      19:57:11,754 ERROR [STDERR] at org.jboss.aop.AspectManager.getAdvisors(AspectManager.java:546)
      19:57:11,754 ERROR [STDERR] at org.jboss.console.plugins.AOPLister$RefreshPoller.run(AOPLister.java:891)
      19:57:15,473 ERROR [STDERR] Exception in thread "RMI TCP Connection(idle)"
      19:57:19,254 ERROR [STDERR] Exception in thread "Thread-12"
      19:57:46,223 ERROR [STDERR] Exception in thread "RMI RenewClean-[127.0.0.1:1421]"
      19:57:46,223 ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space
      19:57:49,567 ERROR [STDERR] at java.io.BufferedInputStream.<init>(BufferedInputStream.java:178)
      19:57:52,942 ERROR [STDERR] at java.io.BufferedInputStream.<init>(BufferedInputStream.java:158)
      19:57:52,942 ERROR [STDERR] at sun.rmi.transport.tcp.TCPConnection.getInputStream(TCPConnection.java:85)
      19:57:52,942 ERROR [STDERR] at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:226)
      19:57:52,942 ERROR [STDERR] at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
      19:57:52,942 ERROR [STDERR] at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
      19:57:52,942 ERROR [STDERR] at sun.rmi.transport.DGCImpl_Stub.dirty(Unknown Source)
      19:57:59,676 ERROR [STDERR] at sun.rmi.transport.DGCClient$EndpointEntry.makeDirtyCall(DGCClient.java:342)
      19:57:59,676 ERROR [STDERR] at sun.rmi.transport.DGCClient$EndpointEntry.access$1600(DGCClient.java:153)
      19:57:59,676 ERROR [STDERR] at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:555)
      19:57:59,723 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
      19:58:03,067 ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space
      19:58:06,848 ERROR [STDERR] at java.io.BufferedInputStream.<init>(BufferedInputStream.java:178)
      19:58:06,864 ERROR [STDERR] at java.io.BufferedInputStream.<init>(BufferedInputStream.java:158)
      19:58:06,864 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:679)
      19:58:06,864 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      19:58:10,192 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      19:58:10,192 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      19:58:10,223 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
      19:58:13,973 ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space
      19:58:13,988 ERROR [STDERR] at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.transactionInitiatedRecovery(XARecoveryModule.java
      :442)
      19:58:13,988 ERROR [STDERR] at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:186)
      19:58:13,988 ERROR [STDERR] at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:799)
      19:58:13,988 ERROR [STDERR] at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:412)
      20:15:27,841 ERROR [STDERR] Exception in thread "Timer-Log4jService"
      20:15:27,841 ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space
      20:15:34,919 WARN [HDScanner] Scan failed
      java.lang.OutOfMemoryError: Java heap space
      20:18:49,371 WARN [ClassLoaderManager] Unexpected error during load of:org.w3c.dom.Document
      java.lang.OutOfMemoryError: Java heap space
      20:19:49,886 ERROR [[/pocgwt]] Exception while dispatching incoming RPC call
      com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String[] com.bioimagene.poc.client.Poc.getAllCases()' th
      rew an unexpected exception: java.lang.NoClassDefFoundError: org/w3c/dom/Document
       at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
       at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
       at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
       at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       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:235)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
       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:158)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/Document
       at com.bioimagene.poc.server.CaseUser.<init>(CaseUser.java:24)
       at com.bioimagene.poc.server.App.getAllCases(App.java:56)
       at com.bioimagene.poc.server.PocImpl.getAllCases(PocImpl.java:34)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
       ... 24 more
      Caused by: java.lang.ClassNotFoundException: Unexpected error during load of: org.w3c.dom.Document, msg=Java heap space
       at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:165)
       at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:265)
       at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1119)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:798)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:441)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       ... 32 more
      Caused by: java.lang.OutOfMemoryError: Java heap space
      06:16:45,089 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.recovery.ActionStatusService_2] - Other Exception: java.lang.NullPointerException
      06:16:48,870 ERROR [STDERR] java.lang.NullPointerException
      06:16:48,885 ERROR [STDERR] at com.arjuna.ats.arjuna.recovery.ActionStatusService.doWork(ActionStatusService.java:123)
      06:16:48,885 ERROR [STDERR] at com.arjuna.ats.internal.arjuna.recovery.Connection.run(Connection.java:83)
      


      Anyone seen anything like this? I also had the same NoClassDefFoundError when using javax.xml.parsers.DocumentBuilder so I switched to using com.sun.org.apache.xerces.internal.parsers.DOMParser and it stopped complaining about it but that's just a hack/workaround, not really a solution. I also tried to put rt.jar and/or xml-apis-1.0.b2.jar (because they contain the org.w3c.dom classes) in ${jboss_home}/server/default/lib but it still doesn't solve the problem.

      Also, both error messages mention something about the ClassLoader and there was a warning about it earlier--so I'm wondering if that's related at all? Any help or suggestions would be greatly appreciated! Thanks!