views:

233

answers:

2

Say I'm debugging some weird class loading issues of an application deployed inside of a Java EE app server. By some reason it appears, that I have duplicate jars on the class paths of two classloaders (2 different EAR classloaders), and the classes from namespaces of these class loaders need to colaborate.

So the question is following: does exist any tool which can show an image (picture) of class loader tree together with the repository of each class loader? Of course, it's not of big importance to show exactly a picture, if it could be some kind of a dynamic user interface (i.e. like Windows Explorer tree folding/unfolding), I would be very happy.

UPD: I'm using JBoss 5.1.

Thanks

A: 

Which app server are you using?

Other than these, don't think such tool exists.

David Rabinowitz
+1  A: 

In JBoss you can log all classloader events, which should tell you precisely where your conflicting classes are, if you can sift through the verbosity.

Or you can go to the jmx-console, find the jboss.classloader section, find the entry for your ear (something like id="vfszip:/apps/jboss-5.1.0.GA/server/default/deploy/your.war/") and invoke findClassLoaderForClass for the class that's giving you problems.

pra