This might be a general Java programming qustion, but I think it's highly relevant to application programmers working with JBoss, given the complexity of class loading issues...
It would be a great help to be able to know which JAR file was used by the classloader to load a specific class, during the execution of some application code. Essentially I'd like to be able to name a class and be able to ask the classloader "Where are you going to load that from?", the answer presumably being a URL.
The standard Java classloader doesn't appear to be able to provide this functionality. Is there a trick to doing this within JBoss? Alternatively, can someone say for certain that this can't be done?
Use the displayClassInfo operation on the JMImplementation:name=Default,service=LoaderRepository mbean in the jmx-console to get this.