Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4491897

Cannot install top level Exception handler

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 5.0
    • 1.3.0, 1.3.1, 1.4.0
    • core-libs
    • beta
    • generic, unknown, sparc
    • generic, solaris_8



      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

            jjb Josh Bloch
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: