Name: rmT116609 Date: 02/05/2003
DESCRIPTION OF THE PROBLEM :
I am trying to handle uncaught exceptions. The only way that I can do that is to override the ThreadGroup.uncaughtException(Thread t, Throwable e)
method.
This will give me control on all the threads in my application that are started by the application.
It will *not* give me control on the threads that are created by third party libraries or even core java classes, for example: Timer.
The thread that the timer maintains to invoke the run method of TimerTask objects, can get hosed due to a RuntimeException (uncaught) due to an error (
a null pointer exception) in the application space.
Not getting a handle on the uncaught exception prevents me from taking appropriate action for example: shutdown the jvm. Not being able to take some action (such as shutting down) put all my future requests in jeopardy
since the timer thread is hosed (I get an IllegalStateException on the timer on the following operations) rendering my whole application in a non-
functioning state (but still up).
I suggest that we allow a method to be added as a handler to a ThreadGroup class so applications may gain control of the uncaught exceptions.
(Review ID: 164860)
======================================================================
- duplicates
-
JDK-4491897 Cannot install top level Exception handler
- Resolved