0 Replies Latest reply on Mar 20, 2003 6:12 AM by Sean Radford

    Jetty ClassNotFoundException and Struts - ? mortbay bug

    Sean Radford Novice

      Hi,

      Like many before me I'm having a class loader problem with using Struts in JBoss/Jetty. The interesting thing that I've found is that the context classloader that is attempting to load the problem class references its jar.

      The problem class: org.apache.struts.validator.ValidatorPlugin
      The class requesting the ValidatorPlugin: org.apache.struts.action.ActionServlet
      The context ClassLoader: org.mortbay.http.ContextLoader

      Both ValidatorPlugin and ActionServlet are in the same jar (struts.jar), and their is only one instance of this around.

      Any ideas why the ContextLoader can't find the ValidatorPlugin when it knows about struts.jar?

      By the way:
      I've tried with the Java2ClassLoadingCompliance set at both true and false by the way.
      And I've tried moving the jars out of the WEB-INF/lib dir and putting them in the jboss lib dir or the ear and referencing them using the MANIFEST with other, more reasonable, but unsumountable problems.

      (I'm using struts-1.1.RC1 and jboss4alpha-2003031918)

      The ContextLoader.toString():

      2003-03-20 11:06:57,078 INFO [org.jboss.jbossweb] action: ClassLoader: org.mortbay.http.ContextLoader(
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/classes/,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/commons-beanutils.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/commons-collections.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/commons-dbcp.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/commons-digester.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/commons-fileupload.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/commons-lang.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/commons-logging.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/commons-pool.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/commons-validator.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/jakarta-oro.jar,
      file:/C:/Documents and Settings/sradford/Local Settings/Temp/Jetty_0_0_0_0_8080__myproject/webapp/WEB-INF/lib/struts.jar)
      / java.net.FactoryURLClassLoader@ba007e

      And the stack trace:

      java.lang.ClassNotFoundException: org.apache.struts.validator.ValidatorPlugin
      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 java.lang.ClassLoader.loadClass(ClassLoader.java:299)
      at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:566)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:235)
      at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:199)
      at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:201)
      at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:225)
      at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1094)
      at org.apache.struts.action.ActionServlet.init(ActionServlet.java:466)
      at javax.servlet.GenericServlet.init(GenericServlet.java:256)
      at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:219)
      at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:436)
      at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:150)
      at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:490)
      at org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationContext.java:85)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:368)
      at org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:315)
      at org.jboss.deployment.DeploymentInfo.start(DeploymentInfo.java:274)
      at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:143)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:89)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:139)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:155)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:543)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1002)
      at $Proxy11.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:390)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:143)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:89)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:139)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:155)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:543)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:776)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:766)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:574)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:538)
      at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:143)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:89)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:139)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:155)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:543)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:172)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:529)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:195)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:268)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:233)
      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.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:143)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:89)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:139)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:155)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:543)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1002)
      at $Proxy1.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:390)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:143)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:89)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:139)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:155)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:543)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:172)
      at $Proxy6.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:229)
      at org.jboss.deployment.DeploymentInfo.start(DeploymentInfo.java:274)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:143)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:89)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:139)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:155)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:543)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1002)
      at $Proxy1.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:390)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:143)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:89)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:139)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:155)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:543)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:776)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:574)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:538)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:522)
      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.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:143)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:89)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:139)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:155)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:543)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:172)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:330)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:238)
      at org.jboss.Main.boot(Main.java:164)
      at org.jboss.Main$1.run(Main.java:402)
      at java.lang.Thread.run(Thread.java:536)