getappmap / appmap-java

AppMap client agent for Java
Other
80 stars 14 forks source link

agent uses the wrong class loader #198

Closed apotterri closed 1 year ago

apotterri commented 1 year ago

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.

appland-release commented 1 year ago

:tada: This issue has been resolved in version 1.20.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: