I had to create thread dump of web application in tomcat runned as a service without need to restart tomcat. I tried to attach jconsole, jvisualvm, jstack, but without success.
- Tomcat is not jmx remote enabled. (But can't introduce properties - can't restart it)
- I tried to execute applications from the same user as the service, change TEMP, TMP folders
- I want to execute it locally - on the same server as tomcat as no configuration should be needed (hence no restarting) ("Note: This configuration is needed only if you are going to monitor Tomcat remotely. It is not needed if you are going to monitor it locally, using the same user that Tomcat runs with.")
- In jConsole process is showed grayed, sometimes not visible - could not attach it
- In jStack: Insufficient memory or insufficient privilages to attach
- Tomcat is running on Windows machine
Any ideas?
I would have recommended jcmd, but I think it has the same problems with local attach as jstat and the other tools.
According to the following two google hits, "psexec -s jstack PID" seems to be a solution (which I have not tried)
https://www.assetbank.co.uk/support/documentation/knowledge-base/how-to-take-a-java-thread-dump/ https://access.redhat.com/solutions/19170