You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "S. Ali Tokmen (JIRA)" <ji...@apache.org> on 2009/05/27 11:29:06 UTC

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

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


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.


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

Posted by "S. Ali Tokmen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713489#action_12713489 ] 

S. Ali Tokmen commented on FELIX-1183:
--------------------------------------

I guess I've found the source of the issue:

Class: org.apache.felix.ipojo.handlers.jmx.DynamicMBeanImpl
Method: invoke (line 159)

I see that method has a clear "printStackTrace" call. It should instead throw it back to the caller.

> 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
>
> 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.


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

Posted by "S. Ali Tokmen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714381#action_12714381 ] 

S. Ali Tokmen commented on FELIX-1183:
--------------------------------------

Thanks, Pierre

I'll get you a pint at O'Callaghan shortly

> 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.


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

Posted by "Pierre Bourret (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier updated FELIX-1183:
-------------------------------------

              Assignee: Clement Escoffier
    Remaining Estimate: 0h
     Original Estimate: 0h

Fixed at revision 780224.
I just applied the patch and check that everything is still working correctly.

I also deployed a the JMX handler on apache.snapshot (so, you should be able to check it Tuesday. 
Please close the issue if it's ok for you.

Pierre, Thanks for this patch.

PS: Can I also have a pint at O'Callaghan during my next trip to Grenoble ;-) ?

> 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
>            Assignee: Clement Escoffier
>         Attachments: JMX-handler-rethrow-exceptions.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> 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.


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

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier resolved FELIX-1183.
--------------------------------------

    Resolution: Fixed

> 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
>            Assignee: Clement Escoffier
>         Attachments: JMX-handler-rethrow-exceptions.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> 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.


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

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier updated FELIX-1183:
-------------------------------------

    Affects Version/s:     (was: iPOJO-1.4.0)
                       iPOJO-1.0.0
        Fix Version/s: iPOJO-1.4.0

> 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.0.0
>         Environment: SNAPSHOT version, SVN revision 37639
>            Reporter: S. Ali Tokmen
>            Assignee: Clement Escoffier
>             Fix For: iPOJO-1.4.0
>
>         Attachments: JMX-handler-rethrow-exceptions.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> 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.


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

Posted by "S. Ali Tokmen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12715416#action_12715416 ] 

S. Ali Tokmen commented on FELIX-1183:
--------------------------------------

Thanks. Tests on our side seem to pass.

PS: We don't use apache.snapshot, we have our internal Hudson that enjoys recompiling many Apache projects...
PPS: sure you can, Clément :)

> 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
>            Assignee: Clement Escoffier
>         Attachments: JMX-handler-rethrow-exceptions.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> 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.