You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Asaf Lahav <as...@primagrid.com> on 2006/01/16 21:08:34 UTC
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/collections/CursorableLinkedList
Hi all,
I'm testing the apache generic object pool and I'm getting an exception
which is as follows:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/collections/CursorableLinkedList
at
org.apache.commons.pool.impl.GenericObjectPool.<init>(GenericObjectPool.java
:392)
at
org.apache.commons.pool.impl.GenericObjectPool.<init>(GenericObjectPool.java
:266)
at myMain.main(myMain.java:13)
I guess I am probably missing dependencies.
Would appreciate any help.
Thanks,
Asaf Lahav
VP R&D, Prima Grid LTD.
Cellular: 972-54-4717955
Phone: 972-3-6540255
Fax: 972-3-6540254
Re: Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/collections/CursorableLinkedList
Posted by Jacob Kjome <ho...@visi.com>.
At 02:28 PM 1/17/2006 +1300, you wrote:
>This is odd.
>
>A NoClassDefFoundError means that the class named in the exception
>message *could* be found, but that something it depends on could not.
>Unfortunately, java never tells you *what* that something is.
>
>So in this case, Asaf *has* got commons-collections but doesn't have
>something that CursorableLinkedList requires.
>
I wouldn't make this assumption too fast.
>But commons-collections doesn't *have* any dependencies. It just uses
>classes provided by java 1.2.
Usually, this is the case. However, in my experience, I usually only see a
ClassNotFoundException when using reflection to load a class and the class
is not found. In most other cases, I see a NoClassDefFoundError. The
first thing to make sure of is that the class mentioned in the error
message is on the classpath. If it is, then it means what you said; a
dependency of said class is missing leading to it not being able to be
properly loaded. If it isn't, then it can mean that the class was actually
not found.
>
>Asaf: you're not trying to run this on java 1.1 are you?
>Or maybe you have multiple copies of commons-collections in your
>classpath which are at different versions?
If commons-collections is on the classpath, then it very well could be an
issue of multiple copies where at particular version is not what is
required. Or it could be a matter of the classloader hierarchy.
Jake
>
>Regards,
>
>Simon
>
>
>
>
>On Mon, 2006-01-16 at 20:04 -0500, Sandy McArthur wrote:
>> The package of the missing class should be a big clue.
>>
>> org.apache.commons.collections.CursorableLinkedList
>>
>> hrm, Commons Collections looks to be relevant.
>>
>> Also, the download page for Commons Pools gives a big hint too:
>> http://jakarta.apache.org/commons/pool/downloads.html
>>
>> On 1/16/06, Asaf Lahav <as...@primagrid.com> wrote:
>> > I'm testing the apache generic object pool and I'm getting an exception
>which is as follows:
>> >
>> > Exception in thread "main" java.lang.NoClassDefFoundError:
>org/apache/commons/collections/CursorableLinkedList
>> >
>> > I guess I am probably missing dependencies.
>> >
>> > Would appreciate any help.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/collections/CursorableLinkedList
Posted by Simon Kitching <sk...@apache.org>.
This is odd.
A NoClassDefFoundError means that the class named in the exception
message *could* be found, but that something it depends on could not.
Unfortunately, java never tells you *what* that something is.
So in this case, Asaf *has* got commons-collections but doesn't have
something that CursorableLinkedList requires.
But commons-collections doesn't *have* any dependencies. It just uses
classes provided by java 1.2.
Asaf: you're not trying to run this on java 1.1 are you?
Or maybe you have multiple copies of commons-collections in your
classpath which are at different versions?
Regards,
Simon
On Mon, 2006-01-16 at 20:04 -0500, Sandy McArthur wrote:
> The package of the missing class should be a big clue.
>
> org.apache.commons.collections.CursorableLinkedList
>
> hrm, Commons Collections looks to be relevant.
>
> Also, the download page for Commons Pools gives a big hint too:
> http://jakarta.apache.org/commons/pool/downloads.html
>
> On 1/16/06, Asaf Lahav <as...@primagrid.com> wrote:
> > I'm testing the apache generic object pool and I'm getting an exception which is as follows:
> >
> > Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/CursorableLinkedList
> >
> > I guess I am probably missing dependencies.
> >
> > Would appreciate any help.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
RE: Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/collections/CursorableLinkedList
Posted by Asaf Lahav <as...@primagrid.com>.
Thanks Sandy,
As soon as I added common-collections*.jar to the build path everything
worked like a charm.
Asaf Lahav
VP R&D, Prima Grid LTD.
Cellular: 972-54-4717955
Phone: 972-3-6540255
Fax: 972-3-6540254
-----Original Message-----
From: Sandy McArthur [mailto:sandymac@gmail.com]
Sent: Tuesday, January 17, 2006 3:04 AM
To: Jakarta Commons Users List
Subject: Re: Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/collections/CursorableLinkedList
The package of the missing class should be a big clue.
org.apache.commons.collections.CursorableLinkedList
hrm, Commons Collections looks to be relevant.
Also, the download page for Commons Pools gives a big hint too:
http://jakarta.apache.org/commons/pool/downloads.html
On 1/16/06, Asaf Lahav <as...@primagrid.com> wrote:
> I'm testing the apache generic object pool and I'm getting an exception
which is as follows:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/collections/CursorableLinkedList
>
> I guess I am probably missing dependencies.
>
> Would appreciate any help.
--
Sandy McArthur
"He who dares not offend cannot be honest."
- Thomas Paine
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/CursorableLinkedList
Posted by Sandy McArthur <sa...@gmail.com>.
The package of the missing class should be a big clue.
org.apache.commons.collections.CursorableLinkedList
hrm, Commons Collections looks to be relevant.
Also, the download page for Commons Pools gives a big hint too:
http://jakarta.apache.org/commons/pool/downloads.html
On 1/16/06, Asaf Lahav <as...@primagrid.com> wrote:
> I'm testing the apache generic object pool and I'm getting an exception which is as follows:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/CursorableLinkedList
>
> I guess I am probably missing dependencies.
>
> Would appreciate any help.
--
Sandy McArthur
"He who dares not offend cannot be honest."
- Thomas Paine
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org