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

RFE: Request more control for uncaughtExceptions in ThreadGroup

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs
    • sparc
    • solaris_8



      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)
      ======================================================================

            jjb Josh Bloch
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: