Tomcat thread dump

How do I get the icon for dumping all threads (the snapshot camera icon) on a Tomcat run? It appears for my JUnit run. I tried Ctrl-Break on the Tomcat console but it did nothing.

I want to dump all the threads after I hit the stop button and Tomcat looks like it shuts down, e.g., "Disconnected from server", because my Tomcat JVM stopped actually shutting down. 2 of the remaining 21 Threads are not daemons, and I can't see in jconsole which ones they are, so I want to look at a thread dump. But the snapshot icon never appears when I run Tomcat.

I'm using IDEA 6.0.4, Tomcat 5.5.16, JDK 1.5.0_08, and Windows XP SP2.

I'll try getting the dump some other way, like running Tomcat as an application in IDEA, or running it without IDEA. But it's inconvenient...

5 comments
Comment actions Permalink

Hello David,

This feature is already requested (http://www.jetbrains.net/jira/browse/IDEADEV-5251).

How do I get the icon for dumping all threads (the snapshot camera
icon) on a Tomcat run? It appears for my JUnit run. I tried
Ctrl-Break on the Tomcat console but it did nothing.

I want to dump all the threads after I hit the stop button and Tomcat
looks like it shuts down, e.g., "Disconnected from server", because my
Tomcat JVM stopped actually shutting down. 2 of the remaining 21
Threads are not daemons, and I can't see in jconsole which ones they
are, so I want to look at a thread dump. But the snapshot icon never
appears when I run Tomcat.

I'm using IDEA 6.0.4, Tomcat 5.5.16, JDK 1.5.0_08, and Windows XP SP2.

I'll try getting the dump some other way, like running Tomcat as an
application in IDEA, or running it without IDEA. But it's
inconvenient...



0
Comment actions Permalink

David,

When snapshot is not available, you can use JMX.

If you start up the java app in question with JMX support turned on -Dcom.sun.management.jmxremote, then you can use JConsole which ships with the JDK to look at all the threads.

This allows you to still use the inbuilt tomcat runner.

0
Comment actions Permalink

Sorry I forgot to say there is also a remote thread snapshot utility that ships along with jconsole called jstack. Use jps first to find the JMXed process.

0
Comment actions Permalink

Thanks for trying to help.

I used jconsole to see that there were non-daemon threads left, but it only shows the totals. The stack traces in jconsole are missing the "daemon" annotation that they have on the dump. I couldn't find any way in jconsole to see which ones were daemons. Maybe Java 6 can?

I'm using Windows XP, so jstack is not available.

In the end, I ran Tomcat in IDEA as an application, to get its stack dump. But it takes time to configure that way. It probably would have taken less time to not use IDEA and just temporarily edit catalina.sh to start Tomcat in the foreground and dump with ctrl-break.

0
Comment actions Permalink

OK, so there is no way to get that icon on a Tomcat run configuration now. I need to run Tomcat as an application instead.

0

Please sign in to leave a comment.