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

Murali.Sriraman
Creator

I moved from jdk11 to jdk8 which made the errors to go away.  So, jdk11 is not supported by Appdynamics yet?  jdk8 is slightly outdated now and I see its premier support is only until Mar 2022.

Hi Murali

 

AppD supports JDK 11 up to 16 on most of the platforms, can you advise which version of the Agent you downloaded and used?

 

Don't see why it would be an issue itself

 

Ciao



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

Learn more about me in the Community Member Spotlight Q & A

the agent version is 21.10.0.33144.

I tried again switching back to JDK11 but gives same error.  with JDK8 there is no error and works fine.   for my current need this is okay for me to continue with, but later it need to be figured out why this issue occurs.

Hi @Murali.Sriraman,

 

I was told this should be fixed in the 21.11 agent.  Be on the lookout for the new agent release. I don't have a timeline of when this will be going live.

 

 


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 reply.   This is huge limitation of of AppDynamics that it does not support beyond JDK1.8.   This issue is very easily reproducible even with simple "hello world" project of Java SpringBoot application.

 

Looks 21.11 version is still not available yet.  Many of the applications I work is based on JDK11+ features - so, looks I cannot use AppDynamics till it is resolved.

Hi Murali

 

AppDynamics does support JDK 11 upwards - https://docs.appdynamics.com/21.11/en/application-monitoring/install-app-server-agents/java-agent/ja...

 

We have some issues with version 21.10 of the agent as well, can you use a version below e.g 21.9 and test to see if it works?



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

Learn more about me in the Community Member Spotlight Q & A

Hi Mario,

 

We also found the same errors when we instrumented AppD Java Agent v21.1.0 and above with JRE 11 and Tomcat 8/9 combinations.  We have an active ticket with AppD support, and as per latest findings, even v21.11.3 (updated for log4j) is showing the same error messages in the application startup.

 

One of the recent findings is that when we use -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager, the errors showed up in all versions, where as if we use -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager, the error messages are suppressed.

 

We use log4j.jul.LogManager for a specific purpose, overriding the default value set in Tomcat's setenv.sh file and ran into these exceptions/errors in the application startup.

 

Not sure if this setting is supported in JRE 11 and how its conflicting with the default ClassLoaderLogManager class.

 

It would be beneficial to review this issue in details as its impacting AppD agent use for JDK/JRE 11+.

 

Regards,

Senthil

 

I was getting this same error for Java agents running on Corretto 11 and agent version 21.10.  As of version 21.11.3 the agents still failed to start up, but with version 21.11.4 they are starting up now.  We still have an issue with the agents not reporting Java memory metrics (like GCs), but that issue is plaguing us on some of our Java 8 JVMs as well.

Same issue in 22.12.0.34603,
I can see the app agent is distinctly named 1.8-22.12.0.34603, is it because the app agent is only compatible with JDK 1.8 and not above?