You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Friso De Jonge <fr...@logicacmg.com> on 2003/04/24 14:58:23 UTC
RE: java.lang.NoClassDefFoundError: org/apache/cactus/ServletTest
Case problem again.
vincent,
why is it that you should only have cactus.jar in your lib directory, and
not in your classpath ?
friso
-----Original Message-----
From: Vincent Massol [mailto:vmassol@pivolis.com]
Sent: 24 April 2003 08:58
To: 'Cactus Users List'
Subject: RE: java.lang.NoClassDefFoundError:
org/apache/cactus/ServletTestCase problem again.
What can happen is that you have a cactus jar in your system classpath.
Make sure you only have cactus in your WEB-INF/lib directory.
Thanks
-Vincent
-----Original Message-----
From: karthik Guru [mailto:karthik_guru2000@yahoo.com]
Sent: 24 April 2003 09:44
To: Cactus Users List
Subject: Re: java.lang.NoClassDefFoundError:
org/apache/cactus/ServletTestCase problem again.
oops sorry forgot to mention that:
yes i have it in the lib folder. We are using weblogic6.1 sp3.
The application gets deployed just fine. Am able to use the application.
We have a taglibrary jar that is getting used by the JSPs for
rendering.
That jar is present in the WEB-INF/lib folder. That is getting picked up
as well.
thanks
karthik
Christopher Lenz <cm...@gmx.de> wrote:
Hi Karthik,
isn't junit.har missing in WEB-INF/lib?
karthik Guru wrote:
> I understand it is a very common problem reported here. I got cactus
to
> work with our product and now while setting it up for the other, i ran
> into this issue.
>
> this is how my war file is structured:
>
> WEB-INF/lib:
> cactus.jar
> aspectjrt.jar
> commons-logging1.0.jar
> httpclient.jar
> testinfra.jar
> tests.jar
>
> tests.jar has all the tests.
> testinfra.jar has the BaseTestCase (from which all the tests inherit.)
+
> some utilities
> There is no Class-Path attribute defined in testinfra.jar and
tests.jar
> manifests. I assume that everything will get picked up from the
> WEB-INF/lib folder.
>
> I get the NoClassDefFoundError when i run my tests.
> Any idea as to why the cactus.jar is not getting picked up from
web-inf\lib.
>
> java.lang.NoClassDefFoundError: org/apache/cactus/ServletTestCase
> at java.lang.ClassLoader.defineClass0(Native Method)
>
> at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
>
> at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
>
> at
>
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericCla
ssLoader.java:394)
>
> at
>
weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoa
der.java:157)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
>
> at
>
weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAware
ClassLoader.java:47)
>
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
>
> at java.lang.ClassLoader.defineClass0(Native Method)
>
> at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
>
> at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
>
> at
>
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericCla
ssLoader.java:394)
>
> at weblogic.utils.classloaders.GenericClassLoader.findCla
--
Christopher Lenz
/=/ cmlenz at gmx.de
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org
Re: java.lang.NoClassDefFoundError: org/apache/cactus/ServletTest
Case problem again.
Posted by Christopher Lenz <cm...@gmx.de>.
Hi Frisco,
polluting the system classpath should generally be avoided.
That said, it *should* be possible to put cactus.jar in the system
classpath, but then you'd also have to put junit.jar, aspectjrt.jar,
commons-httpclient.jar, commons-logging.jar and servlet.jar/j2ee.jar
(i.e. all the dependancies of Cactus) in the system classpath IIUC.
Don't do that :-)
-chris
Friso De Jonge wrote:
> vincent,
>
> why is it that you should only have cactus.jar in your lib directory, and
> not in your classpath ?
>
> friso
>
> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: 24 April 2003 08:58
> To: 'Cactus Users List'
> Subject: RE: java.lang.NoClassDefFoundError:
> org/apache/cactus/ServletTestCase problem again.
>
>
> What can happen is that you have a cactus jar in your system classpath.
> Make sure you only have cactus in your WEB-INF/lib directory.
>
> Thanks
> -Vincent
>
> -----Original Message-----
> From: karthik Guru [mailto:karthik_guru2000@yahoo.com]
> Sent: 24 April 2003 09:44
> To: Cactus Users List
> Subject: Re: java.lang.NoClassDefFoundError:
> org/apache/cactus/ServletTestCase problem again.
>
> oops sorry forgot to mention that:
> yes i have it in the lib folder. We are using weblogic6.1 sp3.
> The application gets deployed just fine. Am able to use the application.
> We have a taglibrary jar that is getting used by the JSPs for
> rendering.
> That jar is present in the WEB-INF/lib folder. That is getting picked up
> as well.
> thanks
> karthik
>
>
> Christopher Lenz <cm...@gmx.de> wrote:
> Hi Karthik,
>
> isn't junit.har missing in WEB-INF/lib?
>
> karthik Guru wrote:
>
>>I understand it is a very common problem reported here. I got cactus
>
> to
>
>>work with our product and now while setting it up for the other, i ran
>
>
>>into this issue.
>>
>>this is how my war file is structured:
>>
>>WEB-INF/lib:
>>cactus.jar
>>aspectjrt.jar
>>commons-logging1.0.jar
>>httpclient.jar
>>testinfra.jar
>>tests.jar
>>
>>tests.jar has all the tests.
>>testinfra.jar has the BaseTestCase (from which all the tests inherit.)
>
> +
>
>>some utilities
>>There is no Class-Path attribute defined in testinfra.jar and
>
> tests.jar
>
>>manifests. I assume that everything will get picked up from the
>>WEB-INF/lib folder.
>>
>>I get the NoClassDefFoundError when i run my tests.
>>Any idea as to why the cactus.jar is not getting picked up from
>
> web-inf\lib.
>
>>java.lang.NoClassDefFoundError: org/apache/cactus/ServletTestCase
>>at java.lang.ClassLoader.defineClass0(Native Method)
>>
>>at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
>>
>>at
>
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
>
>>at
>>
>
> weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericCla
> ssLoader.java:394)
>
>>at
>>
>
> weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoa
> der.java:157)
>
>>at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
>>
>>at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
>>
>>at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
>>
>>at
>>
>
> weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAware
> ClassLoader.java:47)
>
>>at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
>>
>>at java.lang.ClassLoader.defineClass0(Native Method)
>>
>>at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
>>
>>at
>
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
>
>>at
>>
>
> weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericCla
> ssLoader.java:394)
>
>>at weblogic.utils.classloaders.GenericClassLoader.findCla
>
>
RE: java.lang.NoClassDefFoundError: org/apache/cactus/ServletTestCase problem again.
Posted by Vincent Massol <vm...@pivolis.com>.
Because the Cactus framework needs to be able to call your Test Case
classes and these classes are loaded in the webapp classloader... (and
thus are not visible by the system classloader).
That said, Cactus tries its best by trying to load the class from the
context class loader and thus it will work in a container that behaves
nicely but not in all containers.
-Vincent
> -----Original Message-----
> From: Friso De Jonge [mailto:friso.de.jonge@logicacmg.com]
> Sent: 24 April 2003 14:58
> To: 'Cactus Users List'
> Subject: RE: java.lang.NoClassDefFoundError:
> org/apache/cactus/ServletTestCase problem again.
>
> vincent,
>
> why is it that you should only have cactus.jar in your lib directory,
and
> not in your classpath ?
>
> friso
>
> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: 24 April 2003 08:58
> To: 'Cactus Users List'
> Subject: RE: java.lang.NoClassDefFoundError:
> org/apache/cactus/ServletTestCase problem again.
>
>
> What can happen is that you have a cactus jar in your system
classpath.
> Make sure you only have cactus in your WEB-INF/lib directory.
>
> Thanks
> -Vincent
>
> -----Original Message-----
> From: karthik Guru [mailto:karthik_guru2000@yahoo.com]
> Sent: 24 April 2003 09:44
> To: Cactus Users List
> Subject: Re: java.lang.NoClassDefFoundError:
> org/apache/cactus/ServletTestCase problem again.
>
> oops sorry forgot to mention that:
> yes i have it in the lib folder. We are using weblogic6.1 sp3.
> The application gets deployed just fine. Am able to use the
application.
> We have a taglibrary jar that is getting used by the JSPs for
> rendering.
> That jar is present in the WEB-INF/lib folder. That is getting picked
up
> as well.
> thanks
> karthik
>
>
> Christopher Lenz <cm...@gmx.de> wrote:
> Hi Karthik,
>
> isn't junit.har missing in WEB-INF/lib?
>
> karthik Guru wrote:
> > I understand it is a very common problem reported here. I got cactus
> to
> > work with our product and now while setting it up for the other, i
ran
>
> > into this issue.
> >
> > this is how my war file is structured:
> >
> > WEB-INF/lib:
> > cactus.jar
> > aspectjrt.jar
> > commons-logging1.0.jar
> > httpclient.jar
> > testinfra.jar
> > tests.jar
> >
> > tests.jar has all the tests.
> > testinfra.jar has the BaseTestCase (from which all the tests
inherit.)
> +
> > some utilities
> > There is no Class-Path attribute defined in testinfra.jar and
> tests.jar
> > manifests. I assume that everything will get picked up from the
> > WEB-INF/lib folder.
> >
> > I get the NoClassDefFoundError when i run my tests.
> > Any idea as to why the cactus.jar is not getting picked up from
> web-inf\lib.
> >
> > java.lang.NoClassDefFoundError: org/apache/cactus/ServletTestCase
> > at java.lang.ClassLoader.defineClass0(Native Method)
> >
> > at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
> >
> > at
>
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
> >
> > at
> >
>
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericCla
> ssLoader.java:394)
> >
> > at
> >
>
weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoa
> der.java:157)
> >
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
> >
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
> >
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
> >
> > at
> >
>
weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAware
> ClassLoader.java:47)
> >
> > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
> >
> > at java.lang.ClassLoader.defineClass0(Native Method)
> >
> > at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
> >
> > at
>
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
> >
> > at
> >
>
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericCla
> ssLoader.java:394)
> >
> > at weblogic.utils.classloaders.GenericClassLoader.findCla
>
> --
> Christopher Lenz
> /=/ cmlenz at gmx.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>
>
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
>
>
> ---------------------------------------------------------------------
> 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