Java Reference
In-Depth Information
Table 4.3
JMX exceptions
(continued)
Exception
Description
Wraps exceptions thrown by the
preRegister()
and
preDeregister()
methods of the
MBeanRegistra-
tion
interface
MBeanRegistrationException
Thrown if the MBean server cannot find a specified MBean
class when creating an MBean
ClassNotFoundException
Thrown by the
newInstance()
method from the
Class
class when trying to create an MBean instance
InstantiationException
Thrown by the
Class.forName()
method when the
MBean server is trying to create an MBean instance
IllegalAccessException
Thrown when trying to invoke a non-existent method on an
MBean
NoSuchMethodException
4.5.2
Runtime exceptions
Runtime exceptions are handled in the same manner as other exceptions. Oper-
ations performed on MBeans occur in a
try-catch
statement inside the
JMX
agent, allowing the agent to catch any runtime exceptions and wrap them in a
JMX
exception. The
JMX
framework defines a subclass of
java.lang.RuntimeEx-
ception
called
JMRuntimeException
. In
JMX
, there are subclasses for runtime
exceptions at the agent level and the MBean level. Figure 4.11 shows the class
Figure 4.11
JMX runtime exception hierarchy