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

JMX spec could clarify how MBean RuntimeExceptions are handled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • core-svc
    • beta2
    • generic
    • generic

      The JMX spec is unclear as to what happens when a method implementing an attribute or an operation in an MBean throws a RuntimeException. Close reading implies that it should wrap the exception in a RuntimeMBeanException, but it is not completely clear that it could not wrap it in a RuntimeOperationsException. The spec should explicitly say that it is a RuntimeMBeanException, and that RuntimeOperationsException wraps exceptions that occur before any MBean method is invoked, e.g. getAttribute with a null attribute.

      Model MBeans wrap exceptions coming from methods invoked on the ManagedResource in RuntimeOperationsException, not RuntimeMBeanException. Although this is not clearly specified, changing it would risk breaking existing code. So it is suggested that the existing behaviour be specified explicitly, and also that it be specified that when a Dynamic MBean (of which Model MBeans are a kind) throws a RuntimeOperationsException it is not further wrapped. This also corresponds to existing behaviour.

            emcmanus Eamonn McManus
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: