You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Ashish Paliwal (JIRA)" <ji...@apache.org> on 2009/03/18 10:05:50 UTC
[jira] Resolved: (DIRMINA-676) ObjectMBean throws
NullPointerException when accessing non-existing attributes
[ https://issues.apache.org/jira/browse/DIRMINA-676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ashish Paliwal resolved DIRMINA-676.
------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.0-RC1
Added check for unknown attribute, to avoid null pointer exception. The code checks if the attribute exist, if not an exception is thrown.
Files Modified
org.apache.mina.integration.jmx.ObjectMBean.java
> 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
> Assignee: Ashish Paliwal
> Priority: Trivial
> Fix For: 2.0.0-RC1
>
> Attachments: ObjectMBean.java.patch
>
>
> 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.