JDK-5043152 : JMX spec could clarify how MBean RuntimeExceptions are handled
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-05-06
  • Updated: 2017-05-16
  • Resolved: 2006-08-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 beta2Fixed
Related Reports
Relates :  
Description
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.

Comments
SUGGESTED FIX Add the following text in the PDF specification for the JMX API (section 6.4.3.15, RuntimeOperationsException Class): "If a method in an MBean itself throws a runtime exception, that exception will be wrapped in a RuntimeMBeanException, not a RuntimeOperationsException. The RuntimeOperationsException is used in two cases: when the exception occurs before the MBean is invoked (for example, an attribute name in getAttribute is null), and by Model MBeans to wrap exceptions coming from methods invoked on the Managed Resource."
15-03-2006

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
01-09-2004

EVALUATION Change is nontrivial so cannot be made in Tiger. Should be made in Mustang. ###@###.### 2004-05-06
06-05-2004