08-09-2023 01:40 AM - edited 08-09-2023 01:41 AM
I need to attach to the running java process id 1395 and is issuing below cmd for the same.
$>sudo java -Xbootclasspath/a:/usr/local/java/amazon-corretto-8.252.09.1-linux-x64/lib/tools.jar -jar /home/centos/JavaAgentDownoad/agentapp/javaagent.jar 1395
Getting below exception.
Attaching to VM [1395]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.singularity.ee.agent.appagent.AgentEntryPoint.main(AgentEntryPoint.java:1176)
Caused by: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
... 5 more
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.singularity.ee.agent.appagent.AgentEntryPoint.main(AgentEntryPoint.java:1190)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.singularity.ee.agent.appagent.AgentEntryPoint.main(AgentEntryPoint.java:1176)
Caused by: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
... 5 more
Kindly update on how to resolve the issue.
Solved! Go to Solution.
08-10-2023 01:00 AM - edited 08-11-2023 02:55 AM
Thanks, Its resolved now by updating the path for CATALINA_OPTS env variable.
Actually, I referred earlier “Getting Started Wizard -Java” and had configured env variable “CATALINA_OPTS” in “catalina.sh” file considering base path as “/usr/local”.
Later I referred the “https://developer.cisco.com/learning/modules/appdynamics-fundamentals/fnd-01-appd-apm-java/install-the-appdynamics-java-apm-agent/” and as per this, added another env variable “CATALINA_OPTS” with base path as “/opt/”.
Though the appagent files were relocated w.r.t the path referred in above 2 cases, the duplicate entries for CATALINA_OPTS variable with different path was causing the issue.
Later after removing duplicate env variable entry with incorrect path entry, it is working fine now.
08-09-2023 10:13 AM
Can you provide some details: which sandbox, which Cisco product/API (AppDynamics?)...what are you attempting to accomplish when the error occurs?
08-09-2023 11:11 PM
Thanks.
I am learning from https://developer.cisco.com/learning/modules/appdynamics-fundamentals and is working on
"Java Application Montoring Fundamentals"--->Completed Step 1 . Download the AppDynamics Java APM Agent and is in Step 2. Install the AppDynamics Java APM Agent where I was facing the issue. I have installed the javaagent in a different path and had not executed "chown ". Now seems to be working.
But now the tomcat manager URL is not accessible and tomcat server is not running on 8080.
url: http://10.10.20.10:8080/manager/html
This was accessible yesterday. Server is accessible via ssh otherwise.
Can you share support link where vm issue ticket can be raised or suggest how to resolve this.?
08-10-2023 01:00 AM - edited 08-11-2023 02:55 AM
Thanks, Its resolved now by updating the path for CATALINA_OPTS env variable.
Actually, I referred earlier “Getting Started Wizard -Java” and had configured env variable “CATALINA_OPTS” in “catalina.sh” file considering base path as “/usr/local”.
Later I referred the “https://developer.cisco.com/learning/modules/appdynamics-fundamentals/fnd-01-appd-apm-java/install-the-appdynamics-java-apm-agent/” and as per this, added another env variable “CATALINA_OPTS” with base path as “/opt/”.
Though the appagent files were relocated w.r.t the path referred in above 2 cases, the duplicate entries for CATALINA_OPTS variable with different path was causing the issue.
Later after removing duplicate env variable entry with incorrect path entry, it is working fine now.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide