I know it is technically possible, because there are some commercial libraries that do it. For example, BEA systems seems to have an implementation, as from their javadocs:
http://edocs.bea.com/wljrockit/docs142/jmapi/javadoc/Management%20API/com/bea/jvm/ThreadSystem.html
But I do not know if that implementation is only for their JRockit virtual machine, or they use JNI to access internal JVM data, or if there is something else involved.
I am implementing a rather complex server, and detecting / reporting a deadlock condition would be a great advantage in the development process.
Anyway, thanks for your comments :-)
Thomas Kellerer wrote:
Rodrigo Ruiz schrieb:
Hi all, is there any way to get a stack trace of a given thread?
I want to obtain a full thread stack dump from a JSP, just like the one obtained via kill -QUIT, but I do not find any method in the Thread class that could be used to get this information.
I seem to recall that some code was posted some time ago in this list, but I have not found it in the archives. Any ideas?
PS: What I really want to do is a tool for detecting deadlocks via thread dump analysis :-)
Create an exception within that thread, and write it's stack dump via a StringWriter into a String
Thomas
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
