is there a way to retrieve classes loaded or classloader of the web application?
for example if i use this code :
ClassLoader c=getClass().getClassLoader();
logmsg("c="+c);
URLClassLoader u=(URLClassLoader)c;
URL[] urls=u.getURLs();
for (URL i : urls) {
logmsg("url: "+i);
}
Im getting librairies used by the agent not the web application
Take a look at the Reflections package. It uses javassist to provide runtime class meta-data lookup. In order to locate the correct classpath URLs, it provides a helper class ClasspathHelper. ClasspathHelper provides a couple of static methods that return the URLs for WebApps by passing a ServletContext of the target WebApp: