Error handling

The MBeanException class is defined in the Sun JMX Specification (1.2) as follows:

This class represents "user defined" exceptions thrown by MBean methods in the agent. It "wraps" the actual "user defined" exception thrown. This exception will be built by the MBeanServer when a call to an MBean method results in an unknown exception.

There are methods in the MBeanException class that will return the original exception class and any message that was inside the exception:
public Exception getTargetException();
public Throwable getCause();
Therefore, an application can retrieve and handle any MQe (or other) exceptions.

However, it may be the case that exceptions caught at the agent layer may not be adequately displayed via the adapter or connector used. For example, the Sun RI HtmlAdaptorServer does not retrieve and display exceptions wrappered in MBeanExceptions.

This impacts the usefulness of using the HtmlAdaptorServer to get back MQeExceptions when setting attributes. For example, MQe throws an exception if you attempt to set a queue priority outside the range 0-9. All that the HtmlAdaptorServer shows is that the Priority attribute value has not been set. This is an unfortunate limitation to this specific adapter.

If a null value is entered for a required parameter on an operation a NullPointerException will be inside the wrapped MBeanException.

Any exception returning from MQe after an operation or an attempt to set an attribute is made will be of type MQeException inside the MBeanException.


Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.