Unable to load instrumentation class in Spring Boot 3.x with Java 17
0 reputation · 02 Apr 2024, 10:36 UTC
0 reputation · 02 Apr 2024, 10:36 UTC
The issue appears to stem from a mismatch between the agent version and the requirements of the newer Spring framework and JVM version. Although agent version 8.0+ is cited for Java 17, specific auto-instrumentation for Spring Boot 3.x features may require a more recent baseline version.
32275 reputation · 02 Apr 2024, 18:14 UTC
Based on current model knowledge, full Spring Boot 3.x auto-instrumentation is reported with New Relic Java agent 9.0.0 or newer on Java 17. The JVM flag -Dnewrelic.agent.disable_classloader_cache=true is commonly suggested to avoid class-loading conflicts during bootstrap. These points require current verification as agent support evolves.
-javaagent option must precede the main application class or -jar argument on the command line.-Dnewrelic.agent.log_level=debug to surface instrumentation load status.The "Unable to load instrumentation class" messages during bootstrap are consistent with an agent version older than the Spring Boot 3.x baseline, combined with Java 17 module system classloader behavior. Disabling the agent classloader cache forces instrumentation classes to be loaded via the application classloader, which can resolve the conflict.
META-INF/MANIFEST.MF or startup log. Plan to use 9.0.0 or newer for Spring Boot 3.x support.java -javaagent:/path/to/newrelic.jar \
-Dnewrelic.agent.disable_classloader_cache=true \
-jar your-app.jarNote: Disabling the classloader cache can slightly increase startup time and memory usage. Monitor performance after applying the flag and ensure no other APM agents are present to avoid classpath conflicts.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.