I'm migrating a small tool I wrote for our application that was working on WAS and WLS to JBoss AS 5.1. Basically, the tools helps me to troubleshoot classloading issues: it discovers the classloading hierarchy of a specified class, at runtime, and finds out all classes and jars loaded by each classloader. It is a fairly simple tool - it just uses the Classloader.getPArent() method to get the classloader hierarchy.
The trick that made it work for WLS and WAS was that their classloader implementations either had a 'getClassPath()' method which returned a full list of all classpath entries, or they were instances of the URLClassloader class, and I could use its 'getURLs()' method to get the same info.
Now, it looks like JBoss internal classloaders do not follow the same pattern - so I was wondering if there is some other way to get the same information somehow?
Basically, I want to get a full picture of the classloading hierachy and which classloader loader which classes/jars at runtime. It has to be a runtime information - because I want to be able to find out this information for any instance of a class, be it a servlet, an EJB, a util class or JSP - so that I coudl see where in the classloader hierarchy those objects are, what their sibling loaded resources are and what their parent classloaders are.