United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-5035217 : Dynamic MBeans wrap RuntimeException in RuntimeOperationsException

Details
Type:
Bug
Submit Date:
2004-04-21
Status:
Resolved
Updated Date:
2004-05-28
Project Name:
JDK
Resolved Date:
2004-05-28
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0 (b54)

Related Reports
Relates:
Relates:

Sub Tasks

Description
When the getAttribute, setAttribute, or invoke of a Dynamic MBean throws a RuntimeException, this is wrapped by the MBean Server in a RuntimeOperationsException.  But for Standard MBeans, it is wrapped in a RuntimeMBeanException.  This inconsistency is clearly wrong.  Although the spec is somewhat unclear in this area, it certainly seems that wrapping in RuntimeMBeanException is the correct behaviour.

                                    

Comments
PUBLIC COMMENTS

When the getAttribute, setAttribute, or invoke of a Dynamic MBean throws a RuntimeException, this is wrapped by the MBean Server in a RuntimeOperationsException.  But for Standard MBeans, it is wrapped in a RuntimeMBeanException.
                                     
2004-09-01
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger
tiger-rc

FIXED IN:
tiger
tiger-rc

INTEGRATED IN:
tiger-b54
tiger-rc


                                     
2004-09-01
SUGGESTED FIX

Change DynamicMetaDataImpl so it wraps with RuntimeMBeanException not RuntimeOperationsException.  Need to check other uses of RuntimeOperationsException to see if some of them should actually be RuntimeMBeanException.  RequiredModelMBean is a prime candidate here, though it is probably a lost cause.
                                     
2004-09-01
EVALUATION

In fact, we have three distinct behaviours:
- A Standard MBean's RuntimeException is wrapped in a RuntimeMBeanException.
- A user Dynamic MBean's RuntimeException is wrapped in a RuntimeOperationsException.
- An instance of StandardMBean's RuntimeException is wrapped in a RuntimeMBeanException which is itself wrapped in a RuntimeOperationsException.
Plainly this should be untangled.
###@###.### 2004-04-21

The spec is not 100% clear on the exact meaning of RuntimeOperationsException.  Clearly it is appropriate to throw it when e.g. the ObjectName parameter to MBeanServer.invoke is null.  Reading the text on RuntimeOperationsException alone (e.g. on p119) might lead to the conclusion that it should also be thrown when a getAttribute or invoke on an MBean throws IllegalArgumentException, IndexOutofBoundsException, or NullPointerException.  However, that's not the behaviour implemented for any kind of MBean.  And the spec for RuntimeMBeanException *is* clear that this is the exception to throw when an MBean throws a RuntimeException.  So Dynamic MBeans and the StandardMBean class should be corrected to behave that way, consistent with Standard MBeans.
###@###.### 2004-05-03
                                     
2004-05-03



Hardware and Software, Engineered to Work Together