Unable to attach a Java PID with Jolokia

classic Classic list List threaded Threaded
1 message Options
osustyle osustyle
Reply | Threaded
Open this post in threaded view
|

Unable to attach a Java PID with Jolokia

Hello Jolokia support,

I'm currently using an enterprise application that runs on WebSphere Application Server Network Deployment with a PID.  

I have no issue starting up Hawt.io, but when it comes to the Jolokia agent, I'm having issues.  I started the Java application with the JVM arguments:

 -javaagent:/opt/installs/jolokia/jolokia-jvm-1.6.0-agent.jar=port=8778,host=localhost

Then I started the java application that starts with PID 26796.  

[root@mynetwork]# lsof -i :7507
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    26796 root  360u  IPv6 985458      0t0  TCP *:7507 (LISTEN)

From above, I then kick of the Jolokia agent to list available PIDs, but the above PID is not there hence cannot attach the PID.

[root@mynetwork jolokia]# java -cp tools.jar:jolokia-jvm-1.6.0-agent.jar org.jolokia.jvmagent.client.AgentLauncher 26796 --verbose
Cannot attach to process-ID 26796 (InvocationTarget com.sun.tools.attach.VirtualMachine).
See --help for possible reasons. (command: toggle)
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 org.jolokia.jvmagent.client.util.VirtualMachineHandler.attachVirtualMachine(VirtualMachineHandler.java:68)
        at org.jolokia.jvmagent.client.AgentLauncher.main(AgentLauncher.java:57)
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:118)
        at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:75)
        at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:220)
        ... 6 more