You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HotswapAgent causes InvocationTargetException in a Gradle Gretty project.
servletContainer = 'jetty11' → ERROR (org.hotswap.agent.annotation.handler.PluginClassFileTransformer) - InvocationTargetException in transform method on plugin 'class org.hotswap.agent.plugin.jetty.JettyPlugin' class 'org/eclipse/jetty/webapp/WebXmlConfiguration' of classLoader 'java.net.URLClassLoader'
servletContainer = 'tomcat10' → ERROR (org.hotswap.agent.annotation.handler.PluginClassFileTransformer) - InvocationTargetException in transform method on plugin 'class org.hotswap.agent.plugin.tomcat.TomcatPlugin' class 'org/apache/catalina/webresources/StandardRoot' of classLoader 'java.net.URLClassLoader'
$ hotswapagent-gretty-issue/gradlew -v
------------------------------------------------------------
Gradle 8.12
------------------------------------------------------------
Build time: 2024-12-20 15:46:53 UTC
Revision: a3cacb207fec727859be9354c1937da2e59004c1
Kotlin: 2.0.21
Groovy: 3.0.22
Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024
Launcher JVM: 17.0.12 (JetBrains s.r.o. 17.0.12+1-b1087.25)
Daemon JVM: /Users/u0/.sdkman/candidates/java/17.0.12-jbr (no JDK specified, using current Java home)
OS: Mac OS X 14.7.2 aarch64
The text was updated successfully, but these errors were encountered:
Thanks for the excellent example. It seems that the transformation of WebXmlConfiguration fails because it relies on Thread.currentThread().getContextClassLoader(), which is set to UrlClassLoader. This class loader cannot see the app class loader of the HA. The Java agent is initialized by default in the AppClassLoader. I tried enforcing initialization in the bootstrap loader:
This resolves the first issue, but another one arises. It looks like a deeper investigation will be required. Unfortunately, I don’t know much about Gretty and don’t have enough time to explore it in depth. However, I can provide advice if you decide to dive into it.
The issue
HotswapAgent causes InvocationTargetException in a Gradle Gretty project.
servletContainer = 'jetty11'
→ERROR (org.hotswap.agent.annotation.handler.PluginClassFileTransformer) - InvocationTargetException in transform method on plugin 'class org.hotswap.agent.plugin.jetty.JettyPlugin' class 'org/eclipse/jetty/webapp/WebXmlConfiguration' of classLoader 'java.net.URLClassLoader'
servletContainer = 'tomcat10'
→ERROR (org.hotswap.agent.annotation.handler.PluginClassFileTransformer) - InvocationTargetException in transform method on plugin 'class org.hotswap.agent.plugin.tomcat.TomcatPlugin' class 'org/apache/catalina/webresources/StandardRoot' of classLoader 'java.net.URLClassLoader'
Details
See the details here.
Environment
The text was updated successfully, but these errors were encountered: