2 Replies Latest reply on Jul 14, 2006 12:22 AM by warren crossing

    ClassNotFoundExceptions

    Vijay Kandy Newbie

      Hello,

      I have a EAR which contains a WAR and for some reason I get ClassNotFoundExceptions for classes in WEB-INF/classes. I do not have scoped classloading. Heres a snapshot of log from "org.jboss.web" category:

      [131737,ReplyHeaderFilter,main] Adding header name: X-Powered-By='Servlet 2.4; Tomcat-5.0.28/JBoss-4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)'
      [133906,TomcatDeployer,main] Initialized: {WebApplication: /usr/local/share/jboss-4.0.1sp1/server/all/deploy/management/web-console.war/, URL: file:/usr/local/share/jboss-4.0.1sp1/server/all/deploy/management/web-console.war/, classLoader: java.net.FactoryURLClassLoader@1f95673:33117811} jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/web-console
      [133907,WebModule,main] Started jboss.web.deployment:id=-1286110768,war=web-console.war
      [139045,Tomcat5,main] Begin init
      [139050,Tomcat5,main] Unpacking war to: /usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb-exp.war
      [142378,Tomcat5,main] Replaced war with unpacked contents
      [142379,Tomcat5,main] webContext: /OnRoute
      [142379,Tomcat5,main] warURL: file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb.war/
      [142428,Tomcat5,main] End init
      [142843,Tomcat5,main] Begin init
      [142848,Tomcat5,main] Unpacking war to: /usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/axis-exp.war
      [144857,Tomcat5,main] Replaced war with unpacked contents
      [144858,Tomcat5,main] webContext: /axis
      [144859,Tomcat5,main] warURL: file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/axis.war/
      [144888,Tomcat5,main] End init
      [154386,WebModule,main] Creating jboss.web.deployment:id=-893845111,war=OnRouteWeb.war
      [154387,WebModule,main] Created jboss.web.deployment:id=-893845111,war=OnRouteWeb.war
      [154397,WebModule,main] Creating jboss.web.deployment:id=608267712,war=axis.war
      [154397,WebModule,main] Created jboss.web.deployment:id=608267712,war=axis.war
      [158752,WebModule,main] Starting jboss.web.deployment:id=-893845111,war=OnRouteWeb.war
      [158753,TomcatDeployer,main] webContext: /OnRoute
      [158753,TomcatDeployer,main] warURL: file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb.war/
      [158753,TomcatDeployer,main] webAppParser: org.jboss.web.AbstractWebDeployer$DescriptorParser@ad4264
      [158757,TomcatDeployer,main] deploy, ctxPath=/OnRoute, warUrl=file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb.war/
      [159827,TomcatDeployer,main] AbstractWebContainer.parseWebAppDescriptors, Begin
      [159855,TomcatDeployer,main] Creating ENC using ClassLoader: java.net.FactoryURLClassLoader@1feafba
      [159856,TomcatDeployer,main] ..org.jboss.mx.loading.UnifiedClassLoader3@1db04ed{ url=file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear ,addedOrder=42}
      [159856,TomcatDeployer,main] ..org.jboss.system.server.NoAnnotationURLClassLoader@1888759
      [159856,TomcatDeployer,main] ..sun.misc.Launcher$AppClassLoader@7b7072
      [159856,TomcatDeployer,main] ..sun.misc.Launcher$ExtClassLoader@136228
      [159858,TomcatDeployer,main] Bound java:comp/ORB
      [159858,TomcatDeployer,main] Linked java:comp/UserTransaction to JNDI name: UserTransaction
      [159859,TomcatDeployer,main] addEnvEntries
      [159859,TomcatDeployer,main] linkResourceEnvRefs
      [159859,TomcatDeployer,main] linkResourceRefs
      [159859,TomcatDeployer,main] linkMessageDestinationRefs
      [159859,TomcatDeployer,main] linkEjbRefs
      [159859,TomcatDeployer,main] linkEjbLocalRefs
      [159860,TomcatDeployer,main] linkServiceRefs
      [159860,TomcatDeployer,main] linkSecurityDomain
      [159860,TomcatDeployer,main] No security-domain given, using default: java:/jaas/other
      [159860,TomcatDeployer,main] Linking security/securityMgr to JNDI name: java:/jaas/other
      [159863,TomcatDeployer,main] AbstractWebContainer.parseWebAppDescriptors, End
      [160086,TomcatDeployer,main] Using session cookies default setting
      [160413,ReplyHeaderFilter,main] Adding header name: X-Powered-By='Servlet 2.4; Tomcat-5.0.28/JBoss-4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)'
      [164505,Engine,main] StandardContext[/OnRoute]Marking servlet action as unavailable
      [164506,Engine,main] StandardContext[/OnRoute]Error loading org.jboss.web.tomcat.tc5.WebCtxLoader$ENCLoader@13790eb com.pb.onroute.common.web.OnRouteActionServlet
      java.lang.ClassNotFoundException: com.pb.onroute.common.web.OnRouteActionServlet
       at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:964)
       at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
       at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      


      Also, from server.log I see that WEB-INF/classes of my war file if added to classloader's list:
      2005-04-06 11:57:12,591 DEBUG [org.jboss.deployment.MainDeployer] Begin deployment start file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb.war
      2005-04-06 11:57:12,591 DEBUG [org.jboss.system.ServiceController] starting service jboss.web.deployment:id=-893845111,war=OnRouteWeb.war
      2005-04-06 11:57:12,759 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] Added url: file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb.war/WEB-INF/classes/, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@1db04ed{ url=file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear ,addedOrder=42}
      2005-04-06 11:57:13,326 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] Added url: file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb.war/WEB-INF/lib/OnRouteEJB.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@1db04ed{ url=file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear ,addedOrder=42}
      2005-04-06 11:57:13,348 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.action
      2005-04-06 11:57:13,374 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.actions
      2005-04-06 11:57:13,380 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.config
      2005-04-06 11:57:13,393 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.config.impl
      2005-04-06 11:57:13,399 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts
      2005-04-06 11:57:13,400 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.plugins
      2005-04-06 11:57:13,402 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.resources
      2005-04-06 11:57:13,425 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.bean
      2005-04-06 11:57:13,441 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.html
      2005-04-06 11:57:13,481 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.logic
      2005-04-06 11:57:13,494 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.nested.bean
      2005-04-06 11:57:13,497 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.nested.html
      2005-04-06 11:57:13,508 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.nested.logic
      2005-04-06 11:57:13,517 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.nested
      2005-04-06 11:57:13,523 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.template
      2005-04-06 11:57:13,526 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.template.util
      2005-04-06 11:57:13,527 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.tiles
      2005-04-06 11:57:13,531 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.tiles.ext
      2005-04-06 11:57:13,545 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.taglib.tiles.util
      2005-04-06 11:57:13,546 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.tiles
      2005-04-06 11:57:13,549 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.tiles.actions
      2005-04-06 11:57:13,553 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.tiles.beans
      2005-04-06 11:57:13,558 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.tiles.definition
      2005-04-06 11:57:13,578 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.tiles.xmlDefinition
      2005-04-06 11:57:13,587 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.upload
      2005-04-06 11:57:13,606 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.util
      2005-04-06 11:57:13,625 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.struts.validator
      2005-04-06 11:57:13,635 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] Added url: file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb.war/WEB-INF/lib/struts.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@1db04ed{ url=file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear ,addedOrder=42}
      2005-04-06 11:57:13,637 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.commons.validator
      2005-04-06 11:57:13,648 DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: org.apache.commons.validator.resources
      2005-04-06 11:57:13,663 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] Added url: file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb.war/WEB-INF/lib/commons-validator.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@1db04ed{ url=file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear ,addedOrder=42}
      2005-04-06 11:57:13,666 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] Added url: file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear-contents/OnRouteWeb.war/WEB-INF/lib/maps.jar, to ucl: org.jboss.mx.loading.UnifiedClassLoader3@1db04ed{ url=file:/usr/local/share/jboss-4.0.1sp1/server/all/tmp/deploy/tmp58048OnRoute.ear ,addedOrder=42}
      2005-04-06 11:57:13,712 DEBUG [org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService] It's for me: javax.management.MBeanServerNotification: notificationType=JMX.mbean.registered source=JMImplementation:type=MBeanServerDelegate seq-no=620 time=1112806633712 message=null objectName=jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/OnRoute userData=null, handback:2147483647
      2005-04-06 11:57:13,928 DEBUG [tomcat.localhost./OnRoute.Context] Starting tomcat.localhost./OnRoute.Context
      2005-04-06 11:57:13,929 DEBUG [tomcat.localhost./OnRoute.Context] Configuring default Resources
      2005-04-06 11:57:13,934 DEBUG [org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService] It's for me: javax.management.MBeanServerNotification: notificationType=JMX.mbean.registered source=JMImplementation:type=MBeanServerDelegate seq-no=621 time=1112806633934 message=null objectName=jboss.web:host=localhost,path=/OnRoute,type=Cache userData=null, handback:2147483647
      2005-04-06 11:57:13,952 DEBUG [tomcat.localhost./OnRoute.Context] Processing standard container startup
      2005-04-06 11:57:13,955 DEBUG [org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService] It's for me: javax.management.MBeanServerNotification: notificationType=JMX.mbean.registered source=JMImplementation:type=MBeanServerDelegate seq-no=622 time=1112806633955 message=null objectName=jboss.web:host=localhost,name=JaccContextValve,path=/OnRoute,type=Valve userData=null, handback:2147483647
      2005-04-06 11:57:13,958 DEBUG [org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService] It's for me: javax.management.MBeanServerNotification: notificationType=JMX.mbean.registered source=JMImplementation:type=MBeanServerDelegate seq-no=623 time=1112806633957 message=null objectName=jboss.web:host=localhost,name=StandardContextValve,path=/OnRoute,type=Valve userData=null, handback:2147483647
      2005-04-06 11:57:14,041 DEBUG [tomcat.localhost./OnRoute.Context] Setting deployment descriptor public ID to '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN'
      2005-04-06 11:57:14,186 DEBUG [tomcat.localhost./OnRoute.Context] Setting deployment descriptor public ID to '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN'
      2005-04-06 11:57:14,231 DEBUG [org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService] It's for me: javax.management.MBeanServerNotification: notificationType=JMX.mbean.registered source=JMImplementation:type=MBeanServerDelegate seq-no=624 time=1112806634231 message=null objectName=jboss.web:host=localhost,path=/OnRoute,type=Manager userData=null, handback:2147483647
      2005-04-06 11:57:14,251 DEBUG [tomcat.localhost./OnRoute.Context] Posting standard context attributes
      2005-04-06 11:57:14,251 DEBUG [tomcat.localhost./OnRoute.Context] Configuring application event listeners
      2005-04-06 11:57:14,251 DEBUG [tomcat.localhost./OnRoute.Context] Sending application start events
      2005-04-06 11:57:14,251 DEBUG [tomcat.localhost./OnRoute.Context] Starting filters
      2005-04-06 11:57:14,251 DEBUG [tomcat.localhost./OnRoute.Context] Starting filter 'CommonHeadersFilter'
      2005-04-06 11:57:14,252 DEBUG [tomcat.localhost./OnRoute.Context] Starting filter 'UserFilter'
      


      Can some one please point out whats wrong with my configuration?