views:

968

answers:

2

Hi!
I'm running JBoss 4.0.5 on Windows 2003 x64 and wonder if there is any way to get a dump of all threads?

  • It's stared with FireDaemon so I don't have a console windows in which to ctrl-break.

  • It's running under java 1.5 so jstack won't work.

  • I tried some program someone had made called sendsignal.exe, which I think actually crashed JBoss (not certain, but not going to try it again), if this was because JBoss runs under win x64 or because it runs as LocalSystem and I only have access to an "ordinary" user I don't know. It actually worked on my laptop, but it's 32-bit and I'm running as the same user as JBoss there.

Someone has any other ideas that might work?

A: 

You could just write a jsp that does Thread.getAllStackTraces() and print out the stacktracelements in an amenable format. Then hitting the URL of that jsp at any time would give you the stack dump of all threads at that time.

Gowri
+1  A: 

I actually found a better way than what Gowri suggested (after starting to implementing the jsp).

There is actually a way to dump the threads from the jxm-console in the Server Info MBean, see Generate a thread dump with the JMX Console

Ulf Lindback