11 Replies Latest reply on Jun 20, 2004 1:50 AM by Scott Stark

    URGENT: Classloading issue: No class found even that the cla

    Thomas Hüsler Newbie

      Hi all

      I am still fighting around my classloading problems. Acutally I use JDom and Dom4j with Xerxes as parser... When I try to load some classes I get a class not found exception.

      The following is the call Stack:
      JXML Helper (myEAR) calls...

      XPath (Jdom.jar contained in myEAR but uses the one from the Jboss Bootstrap (Jboss Dir\lib)) creates new Instance of..

      JaxenXPath (contained in the jDom.jar) includes / uses some Sax stuff (SaxPathException) contained in Dom4j.jar

      SaxPathException (contained in dom4j.jar which is in my ear) is attempted to be loaded but not found

      Below the print of org.jboss.util.Debug.displayClassInfo (printed in the JXMLHelper => last class that I have under control):

      14:27:22,777 INFO [STDOUT] Classloading information from JXMLHelper:
      Debug Information for JXmlHelper class itself:

      ch.argentis.base.xml.JXmlHelper(d7cf62).ClassLoader=org.jboss.mx.loading.UnifiedClassLoader3@1a517bd{ url=file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1
      .24/server/tebs/tmp/deploy/tmp55706tebs-0.1-SNAPSHOT.ear ,addedOrder=24}
      ..org.jboss.mx.loading.UnifiedClassLoader3@1a517bd{ url=file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/server/tebs/tmp/deploy/tmp55706tebs-0.1-SNAPSH
      OT.ear ,addedOrder=24}
      ..org.jboss.system.server.NoAnnotationURLClassLoader@e3b895
      ..sun.misc.Launcher$AppClassLoader@e80a59
      ....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/
      ....file:/C:/Entwicklungstools/abaXX/components36/lib/3rdparty/oracle9iR2.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/lib/tools.jar
      ....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/run.jar
      ..sun.misc.Launcher$ExtClassLoader@1ff5ea7
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/dnsns.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/ldapsec.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/localedata.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/sunjce_provider.jar
      ++++CodeSource: (file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/server/tebs/tmp/deploy/tmp55706tebs-0.1-SNAPSHOT.ear-contents/tebs-migration-0.1-SNAP
      SHOT.jar <no certificates>)
      Implemented Interfaces:
      14:27:22,777 INFO [STDOUT] Debug Information for JDom class XPath:

      org.jdom.xpath.XPath(14ad296).ClassLoader=org.jboss.system.server.NoAnnotationURLClassLoader@e3b895
      ..org.jboss.system.server.NoAnnotationURLClassLoader@e3b895
      ..sun.misc.Launcher$AppClassLoader@e80a59
      ....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/
      ....file:/C:/Entwicklungstools/abaXX/components36/lib/3rdparty/oracle9iR2.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/lib/tools.jar
      ....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/run.jar
      ..sun.misc.Launcher$ExtClassLoader@1ff5ea7
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/dnsns.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/ldapsec.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/localedata.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/sunjce_provider.jar
      ++++CodeSource: (file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/lib/jdom.jar <no certificates>)
      Implemented Interfaces:
      ++interface java.io.Serializable(f62373)
      ++++ClassLoader: null
      ++++Null CodeSource
      14:27:22,777 INFO [STDOUT] Debug Information for Dom4J class SAXPathException:

      org.saxpath.SAXPathException(1399ae5).ClassLoader=org.jboss.mx.loading.UnifiedClassLoader3@1a517bd{ url=file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.2
      4/server/tebs/tmp/deploy/tmp55706tebs-0.1-SNAPSHOT.ear ,addedOrder=24}
      ..org.jboss.mx.loading.UnifiedClassLoader3@1a517bd{ url=file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/server/tebs/tmp/deploy/tmp55706tebs-0.1-SNAPSH
      OT.ear ,addedOrder=24}
      ..org.jboss.system.server.NoAnnotationURLClassLoader@e3b895
      ..sun.misc.Launcher$AppClassLoader@e80a59
      ....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/
      ....file:/C:/Entwicklungstools/abaXX/components36/lib/3rdparty/oracle9iR2.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/lib/tools.jar
      ....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/run.jar
      ..sun.misc.Launcher$ExtClassLoader@1ff5ea7
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/dnsns.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/ldapsec.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/localedata.jar
      ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/sunjce_provider.jar
      ++++CodeSource: (file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/server/tebs/tmp/deploy/tmp55706tebs-0.1-SNAPSHOT.ear-contents/dom4j-1.4.jar <no certi
      ficates>)
      Implemented Interfaces:


      Actually when the code then runs through to the XPath and tries to load the SaxPathException I get the following stack trace:

      14:27:22,793 ERROR [LogInterceptor] Unexpected Error:
      java.lang.NoClassDefFoundError: org/saxpath/SAXPathException
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:141)
      at org.jdom.xpath.XPath.newInstance(XPath.java:133)
      at ch.argentis.base.xml.JXmlHelper.getValue(JXmlHelper.java:167)
      at ch.argentis.base.xml.JXmlHelper.getTextOrNull(JXmlHelper.java:133)
      at ch.argentis.base.util.Configuration.getTextOrNull(Configuration.java:158)
      at ch.argentis.base.util.Configuration.getString(Configuration.java:168)
      at ch.argentis.base.util.Configuration.init(Configuration.java:86)
      at ch.argentis.base.util.Configuration.(Configuration.java:68)
      at ch.argentis.base.util.Configuration.(Configuration.java:41)
      at ch.argentis.base.util.logging.LoggerFactory.(LoggerFactory.java:43)
      at ch.argentis.base.persistence.core.common.SystemStartupBean.(SystemStartupBean.java:48)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      at java.lang.Class.newInstance0(Class.java:308)
      at java.lang.Class.newInstance(Class.java:261)
      at org.jboss.ejb.Container.createBeanClassInstance(Container.java:469)
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:168)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:58)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:297)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      at org.jboss.ejb.Container.invoke(Container.java:700)
      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:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)


      For me it looks like jboss has some mess with the classloaders and doesn't loads the class from my ear but tries to load it using the Bootstrap classloader itself...

      Any help is appreciated as no deployment is possible any more

      Kind regards
      tom