In some cases (e.g. when ReflectiveType tries to resolve argument types), the agent calls Class.forName to class name to a Class. Instead, it should be using the class loader installed for the current thread.
This fixes a problem when deploying an app to Tomcat. Rather than putting servlet-api.jar on the JVM's classpath, Tomcat loads it at runtime. This means that, for example, Class.forName("javax.servlet.Filter") will fail, but Thread.currentThread().getContextClassLoader().loadClass("javax.servlet.Filter") will succeed.
In some cases (e.g. when ReflectiveType tries to resolve argument types), the agent calls
Class.forName
to class name to a Class. Instead, it should be using the class loader installed for the current thread.This fixes a problem when deploying an app to Tomcat. Rather than putting servlet-api.jar on the JVM's classpath, Tomcat loads it at runtime. This means that, for example,
Class.forName("javax.servlet.Filter")
will fail, butThread.currentThread().getContextClassLoader().loadClass("javax.servlet.Filter")
will succeed.