You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Pierre Bourret (JIRA)" <ji...@apache.org> on 2009/05/28 14:43:45 UTC

[jira] Updated: (FELIX-1183) iPOJO JMX handler doesn't rethrow exceptions

     [ https://issues.apache.org/jira/browse/FELIX-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pierre Bourret updated FELIX-1183:
----------------------------------

    Attachment: JMX-handler-rethrow-exceptions.patch

The invoke method displays the exceptions on the gateway. According to the JMX API, it must wrap the called method exception in a MBeanException, and re-throw it, in order to advise the caller. 

As the InvocationTargetException (thrown from the Callback.call() method) wraps a Throwable, not an Exception, it is directly wrapped in the MBeanException. So if the method throws an exception e , here is the exceptions chain received by the caller :

     MBeanException
     ...
     Caused by : InvocationTargetException
     ...
     Caused by : e

Any reflection exception while trying to invoke the method will result in a ReflectionException (wrapping the cause).

The patch should follow very shortly.

Thx to the reporter for identifying the source of this issue so fast...

> iPOJO JMX handler doesn't rethrow exceptions 
> ---------------------------------------------
>
>                 Key: FELIX-1183
>                 URL: https://issues.apache.org/jira/browse/FELIX-1183
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0
>         Environment: SNAPSHOT version, SVN revision 37639
>            Reporter: S. Ali Tokmen
>         Attachments: JMX-handler-rethrow-exceptions.patch
>
>
> When we create an MBean with iPOJO (metadata-based dynamic MBean), if any method invoke throws an exception, the exception is not rethrown to the caller.
> Instead, the exception's stack trace is printed back on the OSGi gateway's system.out and the JMX caller gets a "null" return.
> Normally, we expect the JMX call to throw an exception if the MBean has thrown one.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.