4 Replies Latest reply on Dec 2, 2002 12:15 AM by tsangcn

    ClassNotFoundException using Digester

    tsangcn Newbie

      Hello

      I am running JBoss 3.0.4 with JDK 1.4.1

      My app is a webapp contains in a single WAR file
      I have a SetupServlet which will be run when my web app starts

      It will read a list of datasource descriptors from an XML using Apache Digester package


      I have add a rule as follows

      digester.addObjectCreate("datasources", "misc.DataSourceDescriptors");

      But when the digester parse the XML, I get the following exception (taken from server.log)

      2002-11-20 21:00:29,203 ERROR [org.apache.commons.digester.Digester] Begin event threw exception
      java.lang.ClassNotFoundException: misc.DataSourceDescriptors
      at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
      at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:239)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
      at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:247)
      at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:84)
      at org.jboss.mx.loading.LoadMgr.nextTask(LoadMgr.java:234)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:144)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
      at org.apache.commons.digester.Digester.startElement(Digester.java:1237)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1490)
      at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
      at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
      at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
      at org.apache.commons.digester.Digester.parse(Digester.java:1514)
      at misc.SetupServlet.init(SetupServlet.java:69)
      at javax.servlet.GenericServlet.init(GenericServlet.java:256)
      at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:225)
      at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:444)
      at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:163)
      at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:492)
      at org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationContext.java:85)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:414)
      at org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:561)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:225)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:202)

      I have checked many times that the class misc.DataSourceDescriptors is there
      and there are no spelling mistakes

      It seems is that the JBoss UCL cannot find the class, why?

      My WAR file is deployed in server/default/deploy
      the jar files for the Digester package is in server/default/lib
      the class which is not found by UCL is there WEB-INF/classes/misc/DataSourceDescriptors.class in my WAR file


      Please help

      Thanks
      CN