I have a Tomcat installed as a Windows service, and sometimes it hangs when I try to shut it down (through services.msc). I tried attaching to it with a debugger, but I don't seem to be able to understand why it's hanging.
When I try to look at one of the threads by doing "Thread.getThreads()[0]", I get an error from the debugger: "Stack frame unavailable".
If instead of shutting down the entire Tomcat, I just unload all my servlets' contexts, everything works perfectly.
How would you proceed in debugging this? Is this by-definition a bug in Tomcat?