开发者

Given a class name, how to identify where it is loaded from in JBoss AS 5.1.0?

开发者 https://www.devze.com 2023-03-12 02:10 出处:网络
I am looking for a JMX kind of option in JBoss 5.1.0 to find the jar file/location of the jar file/class loader for given a fully qualified 开发者_开发百科class name at run time. This is to understand

I am looking for a JMX kind of option in JBoss 5.1.0 to find the jar file/location of the jar file/class loader for given a fully qualified 开发者_开发百科class name at run time. This is to understand what class loader configuration are in place across applications in a deployment.


It's not really a "JMX kind of option" but maybe this can help you?

Following Java code can be executed to find out where your classes are loaded from:

ProtectionDomain protectionDomain = YourClass.class.getProtectionDomain();
File codeLoc = new File(protectionDomain.getCodeSource().getLocation().getFile());

See this dzone link.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号