I am running Ubuntu server edition and I wanted to take a thread dump of Tomcat.
So, I first tried to find out which PID tomcat uses:
$ jps -l
5809 sun.tools.jps.Jps
But it's not there?
So, I used top
instead and found out the PID 5730.
Then I called jstack to get the thread dump:
$ sudo jstack -l 5730
5730: Unable to open socket file: target process not responding or HotSpot VM not loaded
The -F option can be used when the target process is not responding
What's going on? :-(
I already tried to export CATALINA_TMPDIR as described in Jstack and Jstat stopped working with upgrade to JDK6u23 but that didn't change anything:
$ export CATALINA_TMPDIR=/tmp
$ sudo /etc/init.d/tomcat6 restart
* Stopping Tomcat servlet engine tomcat6
...done.
* Starting Tomcat servlet engine tomcat6
...done.
$ sudo jstack -l 5934 // new PID after restart
5934: Unable to open socket file: target process not responding or HotSpot VM not loaded
The -F option can be used when the target process is not responding
Update:
I also tried sudo -u tomcat6 jstack -l -F 5730 > threaddumpexceptions2.txt
but it only gives me tons of exceptions on the console.
sudo apt-get install tomcat6
(no manual installation via wget).echo $JAVA_HOME
returns me nothing! (Empty line)java -version
gives me this:java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.04.2) OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
Does this make any sense to you? – Ninejps -l
still returns only2316 sun.tools.jps.Jps
.echo $JAVA_HOME
gives/usr/lib/jvm/java-6-openjdk
– Ninesudo kill -QUIT 5244
but that returns me nothing (just a blank new command line) and nothing happens (5244 is the PID of tomcat and -QUIT should send a SIGQUIT to that process). – Nine