JDK-5035217 : Dynamic MBeans wrap RuntimeException in RuntimeOperationsException
  • Type: Bug
  • Status: Resolved
  • Resolution: Fixed
  • Component: core-svc
  • Sub-Component: javax.management
  • Priority: P3
  • Affected Version: 5.0
  • OS: generic
  • CPU: generic
  • Submit Date: 2004-04-21
  • Updated Date: 2017-05-16
  • Resolved Date: 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 Availabitlity Release.

To download the current JDK release, click here.
Other
5.0 b54Resolved
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
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

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

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