#242 JBoss 3.0.0 + Struts 1.x = Trouble

v3.0 Rabbit Hole
closed
nobody
8
2002-06-20
2002-06-19
Brian Topping
No

Hi all,

I'm trying to fix a problem in my code with a missing
library, but having a lot of problem understanding exactly
which library is missing. The exception that is getting
thrown is incorrect. The class is being loaded by a
servlet running under Tomcat, so I suppose that Tomcat
is using the UCL from 3.0. So that's why I'm posting it
here.

BASELINE:

* Win2KSP2
* Jboss 3.0-Tomcat4.0.3 binary release
* Struts CVS from about a week ago
* Xdoclet CVS from about four days ago (but i'm not sure
this matters)

The problem I am looking at is a somewhat familiar one,
the exception returned by the classloader is very vague
with regard to the missing library. I'm just trying to
chase down the missing library.

The servlet is doing a classLoader.loadClass(fooClass).
The classloader is a
org.apache.catalina.loader.WebappClassLoader,
fooClass is on the classpath.

REGRESSION:

1) To start, fooClass is loadable and loads properly with
classLoader.loadClass(fooClass).
2) I add calls to fooClass.
3) The transitive closure on fooClass is no longer
complete.
4) I try to figure out what I am missing.

The trace from the exception thrown from
classLoader.loadClass(fooClass) is at the end. It would
imply that org.apache.struts.action.Action was missing,
but it's not. 'fooClass' is a subclass of Action, fooClass
is the class that I added more code to, and fooClass is
still in the classpath (remember, it worked before I
added the new code). I made sure that the classes that
are imported directly by fooClass are in the webapp
classpath. So the implication is that something in the
deeper transitive closure is missing.

The new code I added, by the way, were EJB client
calls. And yes, I added the entire contents of the
jboss/client directory to the WEB-INF/lib of the WAR.

Any ideas on how I could get something more
informative than that the superclass of fooClass can't
load? I'm trying to find the exact class that is missing
on the classpath. Ack!

This keeps coming up every time I make a change and
forget a library and it's really hard to debug. I don't
presume I know where the problem is, so if it's outside
of JBoss, if I can get some clues how to figure that out,
i'd be eternally grateful. If it's in JBoss, learning how to
figure it out there would be super awesome as well!

thanks!

Brian

23:18:08,673 ERROR [RequestProcessor] No action
instance for path /editRegistration could be created
java.lang.NoClassDefFoundError:
org/apache/struts/action/Action
at java.lang.ClassLoader.defineClass0(Native
Method)
at java.lang.ClassLoader.defineClass
(ClassLoader.java:493)
at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass
(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100
(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run
(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged
(Native Method)
at java.net.URLClassLoader.findClass
(URLClassLoader.java:188)
at
org.jboss.mx.loading.UnifiedClassLoader.findClass
(UnifiedClassLoader.java:227)
at java.lang.ClassLoader.loadClass
(ClassLoader.java:299)
at
org.jboss.mx.loading.UnifiedClassLoader.loadClassLocall
y(UnifiedClassLoader.java:235)
at
org.jboss.mx.loading.UnifiedLoaderRepository.loadClass
FromRepository(UnifiedLoaderRepository.java:387)
at
org.jboss.mx.loading.UnifiedLoaderRepository.loadClass
(UnifiedLoaderRepository.java:146)
at
org.jboss.mx.loading.UnifiedClassLoader.loadClass
(UnifiedClassLoader.java:285)
at java.lang.ClassLoader.loadClass
(ClassLoader.java:292)
at java.net.FactoryURLClassLoader.loadClass
(URLClassLoader.java:553)
at java.lang.ClassLoader.loadClass
(ClassLoader.java:255)
at
org.apache.catalina.loader.WebappClassLoader.loadClas
s(WebappClassLoader.java:1343)
at
org.apache.catalina.loader.WebappClassLoader.loadClas
s(WebappClassLoader.java:1243)
at
org.apache.struts.util.RequestUtils.applicationClass
(RequestUtils.java:190)
at
org.apache.struts.util.RequestUtils.applicationInstance
(RequestUtils.java:216)
at
org.apache.struts.action.RequestProcessor.processActi
onCreate(RequestProcessor.java:314)
at
org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:258)
at org.apache.struts.action.ActionServlet.process
(ActionServlet.java:1161)
at org.apache.struts.action.ActionServlet.doGet
(ActionServlet.java:453)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalD
oFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at
org.apache.catalina.valves.CertificatesValve.invoke
(CertificatesValve.java:246)
at
org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2343)
at
org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at
org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at
org.apache.catalina.valves.AccessLogValve.invoke
(AccessLogValve.java:468)
at
org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at
org.apache.catalina.connector.http.HttpProcessor.proces
s(HttpProcessor.java:1012)
at
org.apache.catalina.connector.http.HttpProcessor.run
(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:484)

Discussion

  • Brian Topping
    Brian Topping
    2002-06-19

    Logged In: YES
    user_id=99236

    I'm attaching a WAR file that exhibits this behavior. It loads
    fine under Tomcat 4.04 standalone.

    FWIW, http://sourceforge.net/tracker/?
    func=detail&atid=376687&aid=570811&group_id=22866 is a
    duplicate of this.

     
  • Brian Topping
    Brian Topping
    2002-06-19

    • priority: 5 --> 8
     
  • Brian Topping
    Brian Topping
    2002-06-19

    Logged In: YES
    user_id=99236

    I'm attaching a WAR file that exhibits this behavior. It loads
    fine under Tomcat 4.04 standalone.

    FWIW, http://sourceforge.net/tracker/?
    func=detail&atid=376687&aid=570811&group_id=22866 is a
    duplicate of this.

     
  • Brian Topping
    Brian Topping
    2002-06-19

    Logged In: YES
    user_id=99236

    I can't upload the problem file. Some problem with
    SourceForge. Please get it from http://www.orb.org/bad.war.

     
  • Brian Topping
    Brian Topping
    2002-06-20

    Logged In: YES
    user_id=99236

    I'll refile this with better information

     
  • Brian Topping
    Brian Topping
    2002-06-20

    • status: open --> closed
     
  • Logged In: NO

    Having similar problem with struts 1.1b1
    EAR loads fine, struts Action servlet loads fine, but when I
    hit the first JSP I get a NoClassDefException for
    org.apache.struts.action.ActionForm although this happens in
    org.apache.struts.util.RequestUtils
    More precisely, the error is:
    [org.apache.struts.util.RequestUtils] Error creating form
    bean of class org.arbfile.web.security.forms.LoginForm
    java.lang.NoClassDefFoundError:
    org/apache/struts/action/ActionForm

    The first non sun class in the stack trace is:
    at
    org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:227)

    it's pretty much the same error that Brian is getting, our
    stack traces are almost identical.

    I'm on WinNT 4.0 SP6 JDK 1.3.1_2 J2EE 1.3.1
    JBoss3.0+Tomcat4.0.3 binary release, Struts 1.1b1, Ant
    1.4.1, XDoclet 1.1.2.

    Got same error with JDK 1.4.0_01