jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@pivolis.com>
Subject RE: NoClassDefFound for ServletTestCase with cactus jar in WEB-INF/lib
Date Tue, 25 Nov 2003 18:58:36 GMT


> -----Original Message-----
> From: Karr, David [mailto:david.karr@wamu.net]
> Sent: 25 November 2003 19:37
> To: Cactus Users List
> Subject: RE: NoClassDefFound for ServletTestCase with cactus jar in
WEB-
> INF/lib
> 
> Sigh.  It almost never fails.  Struggle with a problem for two hours.
> Finally give up and write a note asking about the problem.  Discover
> solution two minutes later.  I forgot that the client side of the test
> needs the cactus jar also (in the "junit" task).

Moore was right it seems... 

That said, if you use the new Cactus 1.5, you'll find that it is easier
and less prone to errors ;-)

-Vincent

> 
> > -----Original Message-----
> > From: Karr, David
> >
> > I'm using Cactus 1.4.1, Tomcat 4.1.24, and JDK 1.4.2.
> >
> > I have an existing web application that has a set of Cactus tests
that
> > work fine.
> >
> > I now have a new application where I'm using a slightly different
> > directory structure, but is otherwise pretty similar.
> >
> > I tried to copy all the setup pieces from the first application to
the
> > second.  The Cactus setup is causing me problems in the second
> > application.
> >
> > In both cases, I build a "test.war" that gets installed into
> > the Tomcat
> > "webapps" dir.  Each war has a "WEB-INF/lib" directory which
contains
> > (among others) the "cactus-1.4.1.jar" file.
> >
> > I'm starting with a single "stubbed" test case class in the second
> > application, just to make sure I get through all the setup
> > tasks.  Once
> > the stubbed test case executes properly, all the hard work is done.
> >
> > For some reason, the second application is failing with an exception
> > like the following.  As I said, the "cactus-1.4.1.jar" file is in
the
> > "WEB-INF/lib" of the war file, just like in the application where
this
> > is working.  The "org.apache.cactus.ServletTestCase" class is in
that
> > jar.  I don't understand what I could possibly do to screw this up.
> > I'll respond with some of the relevant configuration files if
someone
> > doesn't have a quick answer.
> >
> > java.lang.NoClassDefFoundError: org/apache/cactus/ServletTestCase
> > 	at java.lang.ClassLoader.defineClass0(Native Method)
> > 	at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
> > 	at
> > java.security.SecureClassLoader.defineClass(SecureClassLoader.
> > java:123)
> > 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
> > 	at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> > 	at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> > 	at java.security.AccessController.doPrivileged(Native Method)
> > 	at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> > 	at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> > 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
> > 	at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> > 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> > 	at java.lang.Class.forName0(Native Method)
> > 	at java.lang.Class.forName(Class.java:141)
> > 	at
> > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<
> > init>(JUni
> > tTestRunner.java:237)
> > 	at
> > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<
> > init>(JUni
> > tTestRunner.java:210)
> > 	at
> > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.m
> > ain(JUnitT
> > estRunner.java:520)
> > Exception in thread "main"
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org



Mime
View raw message