Java reports NoClassDefFoundError: X despite also reporting [Loaded X] ?!

N

nobrow

Java reports

java.lang.NoClassDefFoundError: ie.ucd.ihl.forrest_srv_1_0.Event

despite the fact that -verbose:class reports

[Loaded ie.ucd.ihl.forrest_srv_1_0.Event]

No unloading of that class is reported, nor should occur, before the
error shows up.

Now this program Im working on does have a horrible architecture,
including some AspectJ stuff that gets invoked after certain classes
are statically initialised, so the problem is most probably related to
that, but just on the off-chance someone knows what this is about, Id
like to throw it out there.

Thanks.

(PS Could it be ClassLoader related? ... Hope not :)
 
M

Mike Schilling

Java reports

java.lang.NoClassDefFoundError: ie.ucd.ihl.forrest_srv_1_0.Event

despite the fact that -verbose:class reports

[Loaded ie.ucd.ihl.forrest_srv_1_0.Event]

No unloading of that class is reported, nor should occur, before the
error shows up.

Now this program Im working on does have a horrible architecture,
including some AspectJ stuff that gets invoked after certain classes
are statically initialised, so the problem is most probably related to
that, but just on the off-chance someone knows what this is about, Id
like to throw it out there.

Thanks.

(PS Could it be ClassLoader related? ... Hope not :)

It must be. The class loader that's reporting the class as loaded must be
different from the one that can't find it.

By the way, classes can only be unloaded together with the ClassLoader that
loaded them, so even if you saw ie.ucd.ihl.forrest_srv_1_0.Event unloaded,
two different class loaders would be involved: the one that loaded the class
(which was later unloaded, together with all of its classes) and the one
looking for it..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top