0 Replies Latest reply on Nov 5, 2002 7:38 PM by David Martinez

    JBoss 3.0.4_tomcat 4.1.12 and Struts 1.0.2 classloading prob

    David Martinez Newbie

      Hello,

      I have an application that uses struts and is working on my current version of JBoss (2.4.x).

      Now I'm trying to upgrade it to the following configuration:

      JBoss 3.0.4_Tomcat-4.1.12
      JDK 1.4.1 (Windows)

      It is a war file with struts.jar.

      The application uses a a custom class that extends from ActionServlet as the servlet (to do common housekeeping such as session cleanup and verifying mode of operation) on all Actions.

      This servlet is loaded and statically init-ed on webapp startup.

      If struts is on WEB-INF/lib in the war, the error during startup that I get is:

      javax.servlet.ServletException: Servlet.init() for servlet action threw exception:
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:952)
      (stack trace)
      14:59:20,641 ERROR [Engine] ----- Root Cause -----
      java.lang.NoClassDefFoundError: org/apache/struts/util/MessageResourcesFactory

      Because it can't find struts classes.

      However, if I move struts.jar to the server/default/deploy, the application deploys and initializes correctly, but when I hit the home page I get:
      15:43:51,575 ERROR [Engine] action: Error creating Action instance for path '/home', class name 'com.food.ui.user.GoHomeAction'
      java.lang.ClassNotFoundException: No ClassLoaders found for: com.food.ui.user.GoHomeAction
      at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:138)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:140)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:140)
      at org.apache.struts.action.ActionServlet.processActionCreate(ActionServlet.java:1630)

      I went to the struts source and processActionCreate in struts does a simple class.forName() of the action class.

      Does anyone know what can be done about this?

      Thanks!

      - David Martinez