AppD Archive

Unable to start javaagent.jar for appdynamics

CommunityUser
Splunk Employee
Splunk Employee

I am trying to start the javaagent.jar for appdynamics. I went to the specific version of appdynamics folder and tried " java -jar javaagent.jar <pid>" 

But it says 

java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at com.singularity.ee.agent.appagent.AgentEntryPoint.main(AgentEntryPoint.java:458)

I have Java 7 in my machine. I am trying to start this in Windows 7 machine.

Another thing will the pid change frequently because i have found it is being changed over a period of time. 

This is stopping me to start the monitoring can someone help me out on this issue and let me know how to resolve this issue.

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

The Java agent is added to the command line of another Java program. In other words you take an existing Java application command line and add a few more switches (one of them being -javaagent). e.g. java -jar myapplication.jar -javaagent javaagent.jar

The Java machine agent, on the other hand, is a separate program that runs on its own Java command line (not with any other application). So the Java machine agent is executed with its own java -jar machineagent.jar command line.

0 Karma

Arun_Dasetty
Super Champion

Hi ,

Are you facing the issue still, please be sure to start java agent as below as earlier stated by peter:

java -javaagent:/mnt/agent1/javaagent.jar  -jar myapplication.jar 

 

-javaagent is jvm arg that need to passed part of jvm startup script, keep us posted if you still facing the issue

0 Karma

Arun_Dasetty
Super Champion

Hi,

We request you to add -javaagent as part of web app server startup settings as stated in doc link https://docs.appdynamics.com/display/PRO40/Java+Supported+Environments#JavaSupportedEnvironments-App... example catalina.sh/bat file for tomcat to monitor server

If you want to monitor standalone jvm server instance, try 

java -javaagent:<agent_dir>/javaagent.jar -jar myapp.jar

where agent-dir is appserveragent.zip exploded folder directory and myapp.jar is the customer jar , hope that information ehlps

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...