ObjectMBean throws NullPointerException when accessing non-existing attributes
------------------------------------------------------------------------------
Key: DIRMINA-676
URL: https://issues.apache.org/jira/browse/DIRMINA-676
Project: MINA
Issue Type: Bug
Components: Integration
Affects Versions: 2.0.0-M4
Reporter: Steve Ulrich
Priority: Trivial
Currently when someone tries to access an attribute via JMX that doesn't exist,
the ObjectMBean throws a NullPointerException.
It would be better to precheck if the attribute exists and throw an
AttributeNotFoundException with a short info, like "Attribute <XYZ> doesn't not
exist".
Stacktrace:
java.lang.NullPointerException
at
org.apache.mina.integration.jmx.ObjectMBean.getAttribute(ObjectMBean.java:168)
at MyTestClass.main(MyTestClass.java:12)
Exception in thread "main" javax.management.MBeanException
at
org.apache.mina.integration.jmx.ObjectMBean.throwMBeanException(ObjectMBean.java:849)
at
org.apache.mina.integration.jmx.ObjectMBean.getAttribute(ObjectMBean.java:173)
at MyTestClass.main(MyTestClass.java:12)
Caused by: java.lang.NullPointerException
at
org.apache.mina.integration.jmx.ObjectMBean.getAttribute(ObjectMBean.java:168)
... 1 more
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.