7 Replies Latest reply on Feb 7, 2007 2:38 PM by Anne Forumer

    No ClassLoaders found

    bkbonner Newbie

      I'm trying to deploy roller in jboss 3.2.1. I'm getting the following exception. When I add xerces and xml-apis to the WEB-INF\lib directory of the war file, I get JBoss errors on startup. I'm confused by how the classloaders are setup. If I put a class file in WEB-INF in the war, then shouldn't JBoss use the classes from xercesImpl.jar and xml-apis.jar in the server\lib directory?

      I'm confused as to how to get this software to run based upon these errors.

      Thanks.

      Brian


      16:57:20,406 ERROR [Digester] Begin event threw exception
      java.lang.ClassNotFoundException: No ClassLoaders found for: org.roller.presentation.tags.menu.MenuImpl
      at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:161)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:175)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
      at org.apache.commons.digester.Rule.begin(Rule.java:200)
      at org.apache.commons.digester.Digester.startElement(Digester.java:1268)
      at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:434)
      at org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:571)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:796)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:752)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1454)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
      at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)
      at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)
      at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1148)
      at org.apache.commons.digester.Digester.parse(Digester.java:1562)
      at org.roller.presentation.tags.menu.RollerMenuModel.(RollerMenuModel.java:74)
      at org.roller.presentation.tags.menu.MenuTag.prepareContext(MenuTag.java:48)
      at org.roller.presentation.tags.VelocityTag.doEndTag(VelocityTag.java:81)
      at org.roller.presentation.tags.menu.EditorNavigationBarTag.doEndTag(EditorNavigationBarTag.java:58)
      at org.roller.presentation.tags.HybridTag.doEndTag(HybridTag.java:63)
      at org.apache.jsp.edit_0002dweblog_jsp._jspx_meth_roller_EditorNavigationBar_0(edit_0002dweblog_jsp.java:305)
      at org.apache.jsp.edit_0002dweblog_jsp._jspService(edit_0002dweblog_jsp.java:138)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1058)
      at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:451)
      at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.roller.presentation.filters.BreadCrumbFilter.doFilter(BreadCrumbFilter.java:65)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.roller.presentation.filters.RequestFilter.doFilter(RequestFilter.java:138)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:551)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
      at java.lang.Thread.run(Thread.java:536)

        • 1. Re: No ClassLoaders found (forgot to add)
          bkbonner Newbie

          Forgot to add that I'm running this with JDK 1.4.1_02

          Brian

          • 2. Re: No ClassLoaders found
            bkbonner Newbie

            Forgot to mention that I'm using JDK 1.4.1_02.

            1. If I throw Xerces203Impl.jar and xml-apis203.jar into WEB-INF\lib, I get the class loader errors on JBoss. This is weird and I can't explain this.

            2. If I don't put the files in WEB-INF\lib, then it uses the xercesImpl and xml-apis from JBOSS\LIB

            and I get the error above.

            Is there an easy way to determine which classloader is being used?

            I'll continue to scour the forums.



            • 3. Re: No ClassLoaders found
              bkbonner Newbie

              OK, I found the document on tracing the classloaders on sourceforge using log4j.

              It's weird--the class that is being loaded:


              java.lang.ClassNotFoundException: No ClassLoaders found for: org.roller.presentation.tags.menu.MenuImpl
              at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:161)
              at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:175)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:255)

              **********
              Is being loaded by the tomcat loader. Should this be loaded by roller.war, instead? This is where the org.roller.presentation.tags.menu.MenuImpl class is found. I suspect this is why the ClassNotFoundException is being thrown.

              Brian
              **********

              [204975,UnifiedClassLoader3,Thread-7] release(1) for :org.jboss.mx.loading.UnifiedClassLoader3@136d2ed{ url=file:/D:/jboss/server/default/deploy/roller.war/ ,addedOrder=33}
              [204975,UnifiedClassLoader3,Thread-7] released, holds: 0
              [204985,UnifiedClassLoader3,Thread-7] attempt(1) was: true for :org.jboss.mx.loading.UnifiedClassLoader3@145fe3b{ url=file:/D:/jboss/server/default/deploy/jbossweb-tomcat.sar/ ,addedOrder=6}
              [204985,LoadMgr,Thread-7] registerLoaderThread, ucl=org.jboss.mx.loading.UnifiedClassLoader3@145fe3b{ url=file:/D:/jboss/server/default/deploy/jbossweb-tomcat.sar/ ,addedOrder=6}, t=Thread[Thread-7,5,jboss], prevT=null
              [204985,LoadMgr,Thread-7] Begin beginLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@11c5bb0{classname: org.roller.presentation.tags.menu.MenuImpl, requestingThread: Thread[Thread-7,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@145fe3b{ url=file:/D:/jboss/server/default/deploy/jbossweb-tomcat.sar/ ,addedOrder=6}, loadedClass: null, loadOrder: 2147483647, loadException: null, threadTaskCount: 0, state: 0}
              [204985,LoadMgr,Thread-7] End beginLoadTask, ClassNotFoundException
              [204995,LoadMgr,Thread-7] Begin endLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@11c5bb0{classname: org.roller.presentation.tags.menu.MenuImpl, requestingThread: Thread[Thread-7,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@145fe3b{ url=file:/D:/jboss/server/default/deploy/jbossweb-tomcat.sar/ ,addedOrder=6}, loadedClass: null, loadOrder: 2147483647, loadException: null, threadTaskCount: 0, state: 0}
              [204995,UnifiedClassLoader3,Thread-7] release(1) for :org.jboss.mx.loading.UnifiedClassLoader3@145fe3b{ url=file:/D:/jboss/server/default/deploy/jbossweb-tomcat.sar/ ,addedOrder=6}
              [204995,UnifiedClassLoader3,Thread-7] released, holds: 0
              [205015,UnifiedClassLoader,Thread-7] getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@136d2ed{ url=file:/D:/jboss/server/default/deploy/roller.war/ ,addedOrder=33}), name=org/roller/presentation/tags/menu/tabbed.tpl, resURL:null
              [205015,UnifiedClassLoader,Thread-7] getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@1fd6f07{ url=file:/D:/jboss/server/default/tmp/deploy/server/default/deploy/hsqldb-ds.xml/35.hsqldb-ds.xml ,addedOrder=16}), name=org/roller/presentation/tags/menu/tabbed.tpl, resURL:null
              [205015,UnifiedClassLoader,Thread-7] getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@ef7d74{ url=file:/D:/jboss/server/default/tmp/deploy/server/default/deploy/jms-ra.rar/32.jms-ra.rar ,addedOrder=13}), name=org/roller/presentation/tags/menu/tabbed.tpl, resURL:null

              • 4. Re: No ClassLoaders found
                bkbonner Newbie

                It turned out that Digester was being loaded by the jbossweb-tomcat.sar classloader. Then when a Digester instance was created and classes were created from the digester, they were running in the jbossweb-tomcat.sar classloader vs. that of the war.

                I added:

                digester.setUseContextClassLoader(true);

                to the code and it fixed the problem.

                My classloader issue is resolved.

                Brian

                • 5. Re: No ClassLoaders found
                  Erez Efrati Newbie

                  I wanted to thank you for your post as it really helped me find and fix my small ClassLoader problem in entirely another 3rd party package.
                  I have gone through the whole story and in the end, a good ending, the same small line was really missing.

                  Again, thanks,

                  Erez

                  • 6. Re: No ClassLoaders found
                    Ken Hammond Newbie

                    When you say you added

                    digester.setUseContextClassLoader(true);

                    where did you add this? Can you elaborate?

                    • 7. Re: No ClassLoaders found
                      Anne Forumer Newbie

                      Thank you Brian!

                      Your post here helped me as well. God Bless You!