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!

What’s New & Next in Splunk SOAR

Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us on ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...