jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taylor,Timothy L." <ttay...@mitre.org>
Subject Re: NoClassDefFoundError Trying to Test Filter
Date Fri, 01 Mar 2002 20:37:00 GMT
I am using the servlet 2.3 version of the cactus jar.  The stack trace I
included in my first post actually showed that the FilterRedirector is
executed.

C:\projects\Metrics\src\lib>jar tvf cactus.jar | grep Filter
   749 Wed Feb 27 17:37:10 EST 2002
org/apache/cactus/client/FilterHttpClient.class
   909 Wed Feb 27 17:37:10 EST 2002
org/apache/cactus/FilterTestCase.class
  2287 Wed Feb 27 17:37:10 EST 2002
org/apache/cactus/server/FilterConfigWrapper.class
   990 Wed Feb 27 17:37:10 EST 2002
org/apache/cactus/server/FilterImplicitObjects.class
  3696 Wed Feb 27 17:37:10 EST 2002
org/apache/cactus/server/FilterTestCaller.class
   779 Wed Feb 27 17:37:10 EST 2002
org/apache/cactus/server/FilterTestController.class
  3393 Wed Feb 27 17:37:10 EST 2002
org/apache/cactus/server/FilterTestRedirector.class

What's got me so confused is that it can find the
FilterTestRedirector.class class file, but it can't find the superclass
of my test class (FilterTestCase).

At first, I thought that it might be caused by the fact that the
AbstractTestCaller class is calling Class.forName() to load the test
classes since this will not work if the class calling forName was loaded
by a ClassLoader higher in the loader chain than the one that can load
the class passed as the argument to forName().  But both cactus.jar and
my test classes are served by the same classloader, so I don't think
this is the problem.

I also tried changing the AbstractTestCaller to use the 3 arg version of
Class.forName() and passing the Thread Context ClassLoader as the third
arg.  This didn't help either, in fact I verified that the ClassLoader
of the AbstractTestCaller is the same as the thread Context ClassLoader.

- Tim Taylor

Vincent Massol wrote:
> 
> Hi Timothy,
> 
> > -----Original Message-----
> > From: Taylor,Timothy L. [mailto:ttaylor@mitre.org]
> > Sent: 01 March 2002 19:48
> > To: cactus-user@jakarta.apache.org
> > Subject: NoClassDefFoundError Trying to Test Filter
> >
> > All,
> >
> > I'm trying to use cactus 1.2 to test a filter in the Oracle OC4J app
> > server, which is actually Orion (1.5.x, I believe).  I've followed the
> > getting started guide correctly, in terms of setting up the server
> side
> > classpath, but I've been unable to get this test to work.
> >
> > Here's my setup:
> > - I'm deploying a web application archive (WAR) in an EAR file.
> > - The WAR file has the following layout:
> > WEB-INF
> >   |- web.xml [contains entries for the cactus redirectors]
> >   |- classes [My classes under test and test classes
> >   |- lib
> >      |- cactus.jar
> >      |- junit.jar
> >      |- log4j-core.jar
> >
> 
> so far so good.
> 
> > When I run the junit test from my ANT build file, the test report that
> > is generated contains the following error:
> >
> >   <testcase name="testDoFilter" time="1.202">
> >     <error message="org/apache/cactus/FilterTestCase"
> >
> type="org.apache.cactus.client.ServletExceptionWrapper">java.lang.NoClas
> sD
> > efFoundError:
> > org/apache/cactus/FilterTestCase
> >         at java.lang.ClassLoader.defineClass0(Native Method)
> 
> [snip]
> 
> hum ... The only reason I can see at this point has to do with the
> Cactus jar you're using. Are you sure you're using the Cactus for
> Servlet API 2.3 and not the one for Servlet 2.2 (which does not contain
> the FilterTestCase) ?
> 
> >
> > The cactus server log file contains the following entries: [Formatting
> > altered slightly to improve readability]
> >
> 
> [snip]
> 
> > I would be most grateful if anyone could shed any light on this
> > problem.  It appears to be a problem with my classpath, but I can't
> > figure out how to fix it.
> >
> > Thanks in advance,
> > - Tim
> >
> 
> Thanks
> -Vincent
> 
> > --
> > To unsubscribe, e-mail:   <mailto:cactus-user-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:cactus-user-
> > help@jakarta.apache.org>
> >
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message