Splunk AppDynamics

failed to attach agent to server

Amr_Gamal
Explorer

hello , 

I'm using macOS sierra , firstly i installed  java(jdk 9.0.1) after that i installed the apache tomcat server and it worked successfully after that i followed the instructions in the video of installing java agent ; as i downloaded the agent and followed the steps but i can't attach the server to the agent due to the error (in the below screenshot):

image.pngi noticed that tools.jar not exist in the JDK lib folder , but i don't know why and is it the problem or what ?

how can i fix this issue , please ?

Thanks

Labels (1)
0 Karma

Peter_Holditch
Builder

java 9 removed tools.jar from the distribution, and also removed the -Xbootclasspath option (see the modules spec)

You should find that the agent will attach to your running tomcat if you simply remove this option from the command line.

Warm regards,
Peter

0 Karma

Amr_Gamal
Explorer

thanks peter for your support ,but i tried it but it failed also so could you tell me what needs to be modified in the command so that it can attached successfully ,the original command :

sudo java -Xbootclasspath/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/lib/classes.jar -jar /Users/amrgamal/Downloads/AppServerAgent-4/ver4.3.3.9/javaagent.jar

Best Regards 

Amr 

0 Karma

Peter_Holditch
Builder

I just noticed from the path in your command that you are using version 4.3.3.9 of the agent.

JDK9 support was a new feature we introduced in the 4.4 release, so you will need to upgrade to a 4.4 agent and controller, or downgrade to jdk 8 to get this working.

Warm regards,
Peter

0 Karma

Amr_Gamal
Explorer

i downgraded to jdk but the issue still the same as below screen shot .

is there something else i should do or check for ??

thanks a lot image.png

0 Karma

Peter_Holditch
Builder

Are you sure the java command hasn't picked up the java 9 JDK?

What happens if you replace "java" with "/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java" ?

0 Karma

Amr_Gamal
Explorer

yeah i'm sure i removed jdk9

the same error happened image.png

0 Karma

Peter_Holditch
Builder

Ah, I just noticed that your bootclasspath option is slightly malformed

From the documentation, you want to run the command like this:

java -Xbootclasspath/a:<path_to_jdk>/lib/tools.jar -jar /<agent_home>/javaagent.jar <jvm_process_id>

you're missing the "/a:" part, and the process ID of your running tomcat.  Can you try adding these?

0 Karma

Amr_Gamal
Explorer

nice , i modified the command and get the process id but it raised an exception ,

i think the problem is in the process id , it check for it but it changed over time image.png

image.png

0 Karma

Amr_Gamal
Explorer

Any recommendations ??

0 Karma

Peter_Holditch
Builder

So, from the above 2282 was the pid of jps itself, which explains why you can't attach to that, since it stopped running before you tried.

The second process, called "bootstrap" is presumably your tomcat, so try to attach to that.  (you could see the full command line by adding the -v option to your jps command)

If you're having toruble connecting to the tomact dynamically, you could try to add the javaagent as a tomcat startup parameter, as documented here.

0 Karma

Amr_Gamal
Explorer

i executed the full command line with -v parameter and it returned 2 ids then 

i tried to execute the command of attaching the agent but it also failed with the same error with both 2 ids

i tried to add the javaagent as a tomcat startup parameter but no changes happened 

i'm really got frustrated , any suggestions in order to try appdynamics 

or is there another way to practice on appdynamics

thank

image.png

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Synthetic Monitoring - Resolved Incident on Detector Alerts

We’ve discovered a bug that affected the auto-clear of Synthetic Detectors in the Splunk Synthetic Monitoring ...

Video | Tom’s Smartness Journey Continues

Remember Splunk Community member Tom Kopchak? If you caught the first episode of our Smartness interview ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud? Learn how unique features like ...