Closed gquintana closed 5 years ago
Good point!
I can recall one more reason. Target JVM may have -Dtmp.io.dir
pointing to non-defalt location.
I would extend error message.
@aragozin you can also add JDK
installed as prerequisite since with JRE
it can't attach
Java home points to /usr/java/jre1.8.0_66 make sure it is not a JRE path
Failed to add tools.jar to classpath
java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.gridkit.lab.jvm.attach.AttachAPI.<clinit>(AttachAPI.java:45)
at org.gridkit.lab.jvm.attach.AttachManager.<clinit>(AttachManager.java:73)
at org.gridkit.jvmtool.JmxConnectionInfo.getMServer(JmxConnectionInfo.java:72)
at org.gridkit.jvmtool.cmd.GcRepCmd$GcRep.run(GcRepCmd.java:63)
at org.gridkit.jvmtool.cli.CommandLauncher.start(CommandLauncher.java:133)
at org.gridkit.jvmtool.SJK.main(SJK.java:11)
Error message now points to https://github.com/aragozin/jvm-tools/blob/master/sjk-core/docs/TROUBLESHOOTING.md
As a newcomer, I wish I had read some advice to troubleshoot connection between sjk and my app:
sudo -u elasticsearch java -jar sjk.jar ttop -p <elasticsearch pid>
and test the connection with jstack before using sjkThis would have saved me hours of investigation.