commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/CursorableLinkedList
Date Tue, 17 Jan 2006 04:26:17 GMT
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 <asaf.lahav@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


Mime
View raw message