I like to generate a thread dump programmatically. I\'ve learned that there a basically two ways to do it:
You can get just about all the Thread info you need including deadlocks from http://java.sun.com/javase/6/docs/api/java/lang/management/ThreadMXBean.html