i had tried to attach valid PID to jvm agent by using different version of jdk..however, it does not work..the following is the error message shown in command line...can some one provide the solution? thanks in advanced
It seems that you try to attach to a JVM which already has something other attached (maybe already another agent ?). There's not much I can help but you can try to attach the agent during startup of the other Java process with `-javaagent:jolokia.jar`, then the process should share the same native attach library.
Sorry roland, what do you mean by attach to a JVM which already has something other attached?jvm-agent?and shoud i put any .jar file to the application which i need to monitor?sry,i really need it for my project
You should check out, how the application you want attach to is started. This is typically a startup script or .bat file. Within this you will find finally a call to `java` with some options. One of the options is probably `-javaagent` which installs another agent (not jolokia). You can simply add `-javaagent:/path/to/jolokia.jar` as it is described in the reference manual to this line.
Then this should work. I don't think dynamically attaching (i.e. attaching to an already running Java process) will work in your case.
We are unable to attach the JVM agent to pid of flink process with jmx enabled on it.
We are using java 1.8, java hotspot is enabled, and doing it with the same UID only.
Also there are no other agents attached to that process.
Yet we are not able to bind the JVM agent with that process.
Invocation Target class com.sun.tools.attach.VirtualMachine <command:start> : null
Invocation Target class com.sun.tools.attach.VirtualMachine <command:status> : null