You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by flourish <co...@dork.com> on 2001/03/26 05:41:22 UTC

NoClassDefFoundError after having imported custom class

    I have some of my own classes in a jar file.  I have that jar file in
JServ's classpath.  I import a package in the jar using xsp:include.  I can
use one of the objects in that package without any problems, but when I try
to use the other I get a NoClassDefFoundError.  I was importing the package,
so I tried importing the actual classes by individual name.  The import
statement runs fine, but when I try to use an object of the class, it throws
the error.  It may be noteworthy that I'm not actualy using the class's
constructor in my xsp page.  Another class in the package constructs an
object of the problem class and returns it.  If I call the method that
returns the object but don't attempt to create a variable to store the
results in, it works fine.  And I know the class in question works fine
outside of Cocoon.
    Anyone have any sudgestions?

Thanks,
Matt


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: NoClassDefFoundError after having imported custom class

Posted by flourish <co...@dork.com>.
    Well I repacked my classes into another jar and it worked.  I don't
know... maybe something was fudged in the previous jar.  ..shrug..
    But maybe you can figure something else out.  I can include my own
classes by including a jar in JServ's classpath, but I can't seem to include
classes that aren't in a jar.  I've tried putting the root directory of the
package, the parent directory of that directory, and the directory with the
actual classes in it in a JServ's classpath.  None of them seem to do the
trick.

Thanks,
Matt

----- Original Message -----
From: "Ingo Bruell" <ib...@gmx.de>
To: "flourish" <co...@xml.apache.org>
Sent: Tuesday, March 27, 2001 1:04 PM
Subject: Re: NoClassDefFoundError after having imported custom class


> Hallo flourish,
>
> am Monday, March 26, 2001, um 5:41:22 AM, hast Du folgendes geschrieben:
>
> f>     I have some of my own classes in a jar file.  I have that jar file
in
> f> JServ's classpath.  I import a package in the jar using xsp:include.  I
can
> f> use one of the objects in that package without any problems, but when I
try
> f> to use the other I get a NoClassDefFoundError.  I was importing the
package,
> f> so I tried importing the actual classes by individual name.  The import
> f> statement runs fine, but when I try to use an object of the class, it
throws
> f> the error.  It may be noteworthy that I'm not actualy using the class's
> f> constructor in my xsp page.  Another class in the package constructs an
> f> object of the problem class and returns it.  If I call the method that
> f> returns the object but don't attempt to create a variable to store the
> f> results in, it works fine.  And I know the class in question works fine
> f> outside of Cocoon.
>
> It  looks  like  you have a problem with the classloader. I think, that
> different  ClassLoaders  are  used.  One from JServ's classpath and one
> from Cocoon. So if you pass an instance from JServ to cocoon it is not
> an object of the same class for java.
>
> bis dann
>
>
> Ingo Bruell
>
> ---
> <ib...@gmx.de>
> <In...@epost.de>
> <ICQ# 40377720>
> Oldenburg    PGP-Fingerprint: CB01 AE12 B359 87C4 BF1C  953C 8FE7 C648
169E E5FC
> Germany      PGP-Public-Key available at pgpkeys.mit.edu
>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: NoClassDefFoundError after having imported custom class

Posted by Ingo Bruell <ib...@gmx.de>.
Hallo flourish,

am Monday, March 26, 2001, um 5:41:22 AM, hast Du folgendes geschrieben:

f>     I have some of my own classes in a jar file.  I have that jar file in
f> JServ's classpath.  I import a package in the jar using xsp:include.  I can
f> use one of the objects in that package without any problems, but when I try
f> to use the other I get a NoClassDefFoundError.  I was importing the package,
f> so I tried importing the actual classes by individual name.  The import
f> statement runs fine, but when I try to use an object of the class, it throws
f> the error.  It may be noteworthy that I'm not actualy using the class's
f> constructor in my xsp page.  Another class in the package constructs an
f> object of the problem class and returns it.  If I call the method that
f> returns the object but don't attempt to create a variable to store the
f> results in, it works fine.  And I know the class in question works fine
f> outside of Cocoon.

It  looks  like  you have a problem with the classloader. I think, that
different  ClassLoaders  are  used.  One from JServ's classpath and one
from Cocoon. So if you pass an instance from JServ to cocoon it is not
an object of the same class for java.

bis dann


Ingo Bruell

---
<ib...@gmx.de>
<In...@epost.de>
<ICQ# 40377720>
Oldenburg    PGP-Fingerprint: CB01 AE12 B359 87C4 BF1C  953C 8FE7 C648 169E E5FC
Germany      PGP-Public-Key available at pgpkeys.mit.edu



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>