cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error in configuring javaagent in Spring Boot application

Murali.Sriraman
Creator

I configured the javaagent for the springboot application with the exact steps in the Getting Started wizard, however, when I start the spring boot application, I am getting below error.  The agent is not getting started and the application is not getting detected by appdynamics.  Can you please help resolve.   Thanks.

 

Java 9+ detected, booting with Java9Util enabled.
Full Agent Registration Info Resolver using selfService [true]
Full Agent Registration Info Resolver using selfService [true]
Full Agent Registration Info Resolver using ephemeral node setting [false]
Full Agent Registration Info Resolver using application name [Create User]
Full Agent Registration Info Resolver using tier name [app-tier]
Full Agent Registration Info Resolver using node name [laptop]
Install Directory resolved to[C:\dev\code\spring-boot-rest-api-tutorial-master\appagent]
getBootstrapResource not available on ClassLoader
Class with name [com.ibm.lang.management.internal.ExtendedOperatingSystemMXBeanImpl] is not available in classpath, so will ignore export access.
java.lang.ClassNotFoundException: Unable to load class io.opentelemetry.sdk.resources.ResourceProvider
at com.singularity.ee.agent.appagent.kernel.classloader.Post19AgentClassLoader.findClass(Post19AgentClassLoader.java:73)
at com.singularity.ee.agent.appagent.kernel.classloader.AgentClassLoader.loadClassInternal(AgentClassLoader.java:422)
at com.singularity.ee.agent.appagent.kernel.classloader.Post17AgentClassLoader.loadClassParentLast(Post17AgentClassLoader.java:69)
at com.singularity.ee.agent.appagent.kernel.classloader.AgentClassLoader.loadClass(AgentClassLoader.java:320)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at com.singularity.ee.agent.appagent.AgentEntryPoint.createJava9Module(AgentEntryPoint.java:796)
at com.singularity.ee.agent.appagent.AgentEntryPoint.premain(AgentEntryPoint.java:632)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.singularity.ee.agent.appagent.AgentEntryPoint$1.run(AgentEntryPoint.java:649)
Caused by: java.lang.IllegalAccessError: class org.apache.logging.log4j.core.LoggerContext (in module com.appdynamics.appagent) cannot access class java.beans.PropertyChangeEvent (in module java.desktop) because module com.appdynamics.appagent does not read module java.desktop
at com.appdynamics.appagent/org.apache.logging.log4j.core.LoggerContext.updateLoggers(LoggerContext.java:657)
at com.appdynamics.appagent/org.apache.logging.log4j.core.LoggerContext.updateLoggers(LoggerContext.java:644)
at com.appdynamics.appagent/org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:550)
at com.appdynamics.appagent/org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:620)
at com.appdynamics.appagent/org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:637)
at com.appdynamics.appagent/org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)
at com.appdynamics.appagent/org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:243)
at com.appdynamics.appagent/org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
at com.appdynamics.appagent/org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)
at com.appdynamics.appagent/org.apache.logging.log4j.LogManager.getLogger(LogManager.java:648)
at com.appdynamics.appagent/com.singularity.ee.agent.util.log4j.ADLoggerFactory.getLogger(ADLoggerFactory.java:61)
at com.appdynamics.appagent/com.singularity.ee.agent.util.bounded.collections.BoundsEnforcer.<clinit>(BoundsEnforcer.java:53)
at com.appdynamics.appagent/com.singularity.ee.agent.util.bounded.collections.BoundsEnforcer$Builder.build(BoundsEnforcer.java:388)
at com.appdynamics.appagent/com.singularity.ee.agent.util.bounded.collections.BoundedConcurrentReferenceHashMap.<init>(BoundedConcurrentReferenceHashMap.java:73)
at com.appdynamics.appagent/com.singularity.ee.agent.util.bounded.collections.BoundedConcurrentReferenceHashMapBuilder.build(BoundedConcurrentReferenceHashMapBuilder.java:114)
at com.appdynamics.appagent/com.singularity.ee.agent.util.reflect.ReflectionUtility.<clinit>(ReflectionUtility.java:154)
at com.appdynamics.appagent/com.singularity.ee.agent.appagent.kernel.JavaAgent.setLog4j2LoaderUtilDisabled(JavaAgent.java:332)
at com.appdynamics.appagent/com.singularity.ee.agent.appagent.kernel.JavaAgent.setupLog4J2(JavaAgent.java:607)
at com.appdynamics.appagent/com.singularity.ee.agent.appagent.kernel.JavaAgent.initialize(JavaAgent.java:359)
at com.appdynamics.appagent/com.singularity.ee.agent.appagent.kernel.JavaAgent.initialize(JavaAgent.java:346)
... 5 more

Process finished with exit code -1

15 REPLIES 15

Ryan.Paredez
Community Manager

Hello @Akshit.Chaturvedi.,

I followed up with some people and I was told this. 

Download agent JDK8+
https://accounts.appdynamics.com/downloads

Turns out the Installer Wizzard was sending people to an older download. 

Please let me know if that works for you.


Thanks,

Ryan, Cisco AppDynamics Community Manager




Found something helpful? Click the Accept as Solution button to help others find answers faster.

Liked something? Click the Thumbs Up button.



Check out Observabiity in Action

new deep dive videos weekly in the Knowledge Base.

Hi @Ryan.Paredez ,
We are already using JDK8+JVM ver 22.12.0. Screenshot 2023-01-18 at 9.12.23 AM.png

To provide more context this is the exact error:

```

'orgCache' threw exception; nested exception is java.lang.IllegalAccessError: class jdk.jfr.internal.SecuritySupport$$Lambda$1168/0x0000000100f17440 (in module jdk.jfr) cannot access class com.singularity.ee.agent.appagent.entrypoint.bciengine.FastMethodInterceptorDelegatorBoot (in unnamed module @0x1996cd68) because module jdk.jfr does not read unnamed module @0x1996cd68 

```

 

It seems `com.singularity.ee.agent.appagent.entrypoint.bciengine.FastMethodInterceptorDelegatorBoot` class (which comes from  AppD) has been placed inside an unnamed module, if that module could given a name, we could access it and deploy our service.

Ryan.Paredez
Community Manager

Hi @Akshit.Chaturvedi,

Please try adding this 

--add-reads jdk.jfr=ALL-UNNAMED 

Thanks,

Ryan, Cisco AppDynamics Community Manager




Found something helpful? Click the Accept as Solution button to help others find answers faster.

Liked something? Click the Thumbs Up button.



Check out Observabiity in Action

new deep dive videos weekly in the Knowledge Base.

Thanks for your suggestion @Ryan.Paredez ,
I think giving jdk.jfr access to all unnamed modules is a security flaw, it would be appreciated if the module containing com.singularity.ee.agent.appagent could be a given a name in the next patch.

Thanks!

 

Shwetha.Gattu
Creator

Even after adding the argument we still see the issue? Any update on how to fix this?