-
Bug
-
Resolution: Fixed
-
P4
-
6
-
beta2
-
generic
-
generic
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.
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.
- relates to
-
JDK-5035217 Dynamic MBeans wrap RuntimeException in RuntimeOperationsException
-
- Resolved
-