Search code examples
javaclassloader

How can I tell which webapp a classloader belongs to


I have a situation where I have a bunch of classloader instances but no way of knowing what they are for- I know some are for the webapp Is there a way to tell which webapp they belong to ? These are all instances of the same class type btw -not that it makes a difference... Thanks!


Solution

  • I'm not aware of any property that you could use to identify the webapp classloaders as far as a context goes, but you could walk through each of your contexts looking at their associated classloaders and find matches that way.