Java (Java Agent, Installation, JVM, and Controller Installation)

cancel
Showing results for 
Search instead for 
Did you mean: 

AppDynamics unable to connect with java agent

Adventurer

AppDynamics unable to connect with java agent

While connecting java agent with AppDynamics observed below error. please help to resolve this and connect the java agent to AppDynamics:

C:\Windows\system32> java -Xbootclasspath/a:"C:\Program Files\Java\jdk1.8.0_131\lib\tools.jar" -jar "D:\2019\Monitoring_utilities\AppServerAgent\javaagent.jar" 4875
Attaching to VM [4875]
java.util.ServiceConfigurationError: com.sun.tools.attach.spi.AttachProvider: Provider sun.tools.attach.WindowsAttachProvider could not be instantiated
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.singularity.ee.agent.appagent.AgentEntryPoint.main(AgentEntryPoint.java:658)
Caused by: com.sun.tools.attach.AttachNotSupportedException: no providers installed
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:203)

 

I am stuck due to this & unable to use AppDynamics for java resources. 

 

 

AppDynamics unable to connect with java agent
7 REPLIES 7
Highlighted
AppDynamics Team

Re: AppDynamics unable to connect with java agent

Hi Rahul,

 

I see that you are using Dynamic Attach to connect to a live Java process. Is there any reason you can't start the process using the "-javaagent" parameter instead?

 

Dynamic Attach isn't really an AppDynamics feature, rather, a feature of the JVM. The JVM needs to have the correct libraries loaded in order for Dynamic Attach to be successful.

 

It seems that at least for this Windows system that library was not loaded and it's very tricky to get a Native library loaded once the JVM has started.

 

There is some information on this StackOverflow Thread:

 

https://stackoverflow.com/questions/11134159/how-to-load-attachprovider-attach-dll-dynamically

 

I recommend either starting the process with the Javaagent command line parameter and if that is not possible you need the process to be started with the correct java.library.path to the attach.dll native library.

 

Kind Regards,

 

David

Adventurer

Re: AppDynamics unable to connect with java agent

With command line parameter application get successfully started but still shows waiting for the connection. we are referring "Getting started wizard - java".

so please provide details steps if any.

AppDynamics Team

Re: AppDynamics unable to connect with java agent

Hi Rahul,

 

Can you upload a screenshot showing the output, please?

 

Kind Regards,

 

David

Adventurer

Re: AppDynamics unable to connect with java agent

java-connection.png

AppDynamics Team

Re: AppDynamics unable to connect with java agent

I noticed in the command line you didn't specify the required properties:

 

C:\Windows\system32> java -Xbootclasspath/a:"C:\Program Files\Java\jdk1.8.0_131\lib\tools.jar" -jar "D:\2019\Monitoring_utilities\AppServerAgent\javaagent.jar" 4875

 

Try something like this instead with all the values set:

 

java -Xbootclasspath/a:"C:/Program Files/Java/jdk1.8.0_151/lib/tools.jar" -jar C:/appdynamics/AppServerAgent-4.5.8.25115/javaagent.jar 14760 appdynamics.controller.hostName=somehost,appdynamics.controller.port=someport,appdynamics.controller.ssl.enabled=false,appdynamics.agent.accountAccessKey=somevalue,appdynamics.agent.applicationName=Doughuts,appdynamics.agent.tierName=DT1,appdynamics.agent.nodeName=DN1,appdynamics.agent.accountName=someaccount

 

Failing that, are there any logs in the following folder with any useful information?

 

AppServerAgent-4.x.x.xxxxx\ver4.x.x.xxxxx\logs

 

Kind Regards,

 

David

 

 

Adventurer

Re: AppDynamics unable to connect with java agent

Hi,

 

I have already tried this. please check screenshot for error. also, the specified log folder is empty, no log file get generated there.java-connection-error.png

Adventurer

Re: AppDynamics unable to connect with java agent

I have still observed the same issue, even after following the steps provided in the mail.