Hi. Background: I'm maintaining this bloated webapp I inherited. It has an initialization servlet that spawns numerous threads to periodically do batch updates to a database. I'm not allowed to eviscerate this app because "it works", but occasionally one of the threads will die for unknown reasons and the whole thing has to be restarted. There was no logging. Question: I'm adding log4j and would like to see why and when the thread dies. I'd like to catch (and then rethrow) the ThreadDeath error. Where is the best place to do this? Is it as simple as putting a try-catch block in the run method? Thanks! Jon
posted 13 years ago
I may be wrong.. but this is the best I can think of.. put the try catch around the run() /start() method invocation. When thread is interrupted see what happens..