United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-5043152 : JMX spec could clarify how MBean RuntimeExceptions are handled

Details
Type:
Bug
Submit Date:
2004-05-06
Status:
Resolved
Updated Date:
2006-08-31
Project Name:
JDK
Resolved Date:
2006-08-31
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Relates:

Sub Tasks

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."
                                     
2006-03-15
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-09-01
EVALUATION

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



Hardware and Software, Engineered to Work Together