This content has been marked as final. Show 4 replies
Your code looks correct, however I think you have not put a thread in your server at a STUCK state.
To put a thread in a STUCK state you should make the thread to be active for more time than the configured "Stuck Thread Max Time" (default is 600 seconds).
Go to the Admin console, and select the server you want to monitor for stuck threads. In its configuration tab go to Tuning. There you can configure the Stuck Thread Max Time.
Then in your application (EJB, WS, jsp) pause a method that you can invoke with Thread.sleep(1000000);
and then invoke this method.
If your Stuck Thread Max Time is set for example to 600 seconds and you pause the Thread for 1000 seconds (1000000 ms) you will see a stuck thread after 600 seconds from the moment you invoked this method and for 400 seconds untill the Thread.sleep returns.