Name: bsC130419 Date: 08/14/2001
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
The current way of creating a high-level exception catcher is by Subclassing
ThreadGroup and overriding uncaughtException(). This is all nice if you have
control over how the threads are created and can put them in your new
ThreadGroup manually. However if you're using a library that starts its threads
all by itself (I'm using the Sun's JSDT which does this) , you have no control
over how it generates it's threads. It'd be nice if you could somehow install an
exception handler in the "main" threadgroup so you can catch *all* the
exceptions and, for example, log them appropriately.
Alternatively, if you could tell me how to specify the class for the default
"main" threadgroup, that would solve it.
I'm writing quite a large application and so logging exceptions (including
timestamp & thread restart) so we can fix things when they go wrong would be a
really handy feature.
Thanks a lot!
BTW: I think you guys do a pretty good job with all this stuff. Well done!
Keith
(Review ID: 129948)
======================================================================
This RFE has been addressed in the context of JSR-166 (java.util.concurrent).
Use java.lang.Thread.setUncaughtExceptionHandler and/or
java.lang.Thread.setDefaultUncaughtExceptionHandler
###@###.### 2003-10-24
- duplicates
-
JDK-4388491 Provide a system wide exception handler to catch all uncaught exceptions
- Closed
-
JDK-4813752 RFE: Request more control for uncaughtExceptions in ThreadGroup
- Closed