JDK-5035217 : Dynamic MBeans wrap RuntimeException in RuntimeOperationsException
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-04-21
  • Updated: 2017-05-16
  • Resolved: 2004-05-28
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.
Other
5.0 b54Fixed
Related Reports
Relates :  
Relates :  
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
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger tiger-rc FIXED IN: tiger tiger-rc INTEGRATED IN: tiger-b54 tiger-rc
01-09-2004

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.
01-09-2004

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.
01-09-2004

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
03-05-2004