You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Thomas Diesler (JIRA)" <ji...@apache.org> on 2010/03/18 21:46:27 UTC

[jira] Created: (ARIES-259) MBeans not getting unregistered reliably

MBeans not getting unregistered reliably
----------------------------------------

                 Key: ARIES-259
                 URL: https://issues.apache.org/jira/browse/ARIES-259
             Project: Aries
          Issue Type: Bug
          Components: JMX
            Reporter: Thomas Diesler


Closing the MBeanServiceTracker asyncronously triggers JMXAgent.unregisterBeans(MBeanServer server)

If there is a unexpected exception while unregistering an MBeanHandler the ones coming after it will not get unregitered.
In particular I am seeing an unguarded postDeregister hook.

Caused by: java.lang.IllegalStateException: Invalid BundleContext.
	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
	at org.apache.felix.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:170)
	at org.apache.aries.jmx.framework.BundleState.shutDownDispatcher(BundleState.java:353)
	at org.apache.aries.jmx.framework.BundleState.postDeregister(BundleState.java:293)
	at org.apache.aries.jmx.framework.RegistrableStandardEmitterMBean.postDeregister(RegistrableStandardEmitterMBean.java:69)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postDeregisterInvoke(DefaultMBeanServerInterceptor.java:1065)


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


[jira] Commented: (ARIES-259) MBeans not getting unregistered reliably

Posted by "Adam Wojtuniak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847125#action_12847125 ] 

Adam Wojtuniak commented on ARIES-259:
--------------------------------------

BundleState.shutDownDispatcher is missing a check for bundleContext validity.
BundleContext could be no valid cause of asynchronous unregistration of MBeans.


> MBeans not getting unregistered reliably
> ----------------------------------------
>
>                 Key: ARIES-259
>                 URL: https://issues.apache.org/jira/browse/ARIES-259
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>            Reporter: Thomas Diesler
>
> Closing the MBeanServiceTracker asyncronously triggers JMXAgent.unregisterBeans(MBeanServer server)
> If there is a unexpected exception while unregistering an MBeanHandler the ones coming after it will not get unregitered.
> In particular I am seeing an unguarded postDeregister hook.
> Caused by: java.lang.IllegalStateException: Invalid BundleContext.
> 	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
> 	at org.apache.felix.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:170)
> 	at org.apache.aries.jmx.framework.BundleState.shutDownDispatcher(BundleState.java:353)
> 	at org.apache.aries.jmx.framework.BundleState.postDeregister(BundleState.java:293)
> 	at org.apache.aries.jmx.framework.RegistrableStandardEmitterMBean.postDeregister(RegistrableStandardEmitterMBean.java:69)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postDeregisterInvoke(DefaultMBeanServerInterceptor.java:1065)

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


[jira] Updated: (ARIES-259) MBeans not getting unregistered reliably

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

Thomas Diesler updated ARIES-259:
---------------------------------

    Attachment: ARIES-259-20100318.patch

patch attached

> MBeans not getting unregistered reliably
> ----------------------------------------
>
>                 Key: ARIES-259
>                 URL: https://issues.apache.org/jira/browse/ARIES-259
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>            Reporter: Thomas Diesler
>         Attachments: ARIES-259-20100318.patch
>
>
> Closing the MBeanServiceTracker asyncronously triggers JMXAgent.unregisterBeans(MBeanServer server)
> If there is a unexpected exception while unregistering an MBeanHandler the ones coming after it will not get unregitered.
> In particular I am seeing an unguarded postDeregister hook.
> Caused by: java.lang.IllegalStateException: Invalid BundleContext.
> 	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
> 	at org.apache.felix.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:170)
> 	at org.apache.aries.jmx.framework.BundleState.shutDownDispatcher(BundleState.java:353)
> 	at org.apache.aries.jmx.framework.BundleState.postDeregister(BundleState.java:293)
> 	at org.apache.aries.jmx.framework.RegistrableStandardEmitterMBean.postDeregister(RegistrableStandardEmitterMBean.java:69)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postDeregisterInvoke(DefaultMBeanServerInterceptor.java:1065)

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


[jira] Updated: (ARIES-259) MBeans not getting unregistered reliably

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

Thomas Diesler updated ARIES-259:
---------------------------------

    Attachment:     (was: ARIES-259-20100318.patch)

> MBeans not getting unregistered reliably
> ----------------------------------------
>
>                 Key: ARIES-259
>                 URL: https://issues.apache.org/jira/browse/ARIES-259
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>            Reporter: Thomas Diesler
>         Attachments: ARIES-259-20100318.patch
>
>
> Closing the MBeanServiceTracker asyncronously triggers JMXAgent.unregisterBeans(MBeanServer server)
> If there is a unexpected exception while unregistering an MBeanHandler the ones coming after it will not get unregitered.
> In particular I am seeing an unguarded postDeregister hook.
> Caused by: java.lang.IllegalStateException: Invalid BundleContext.
> 	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
> 	at org.apache.felix.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:170)
> 	at org.apache.aries.jmx.framework.BundleState.shutDownDispatcher(BundleState.java:353)
> 	at org.apache.aries.jmx.framework.BundleState.postDeregister(BundleState.java:293)
> 	at org.apache.aries.jmx.framework.RegistrableStandardEmitterMBean.postDeregister(RegistrableStandardEmitterMBean.java:69)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postDeregisterInvoke(DefaultMBeanServerInterceptor.java:1065)

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


[jira] Resolved: (ARIES-259) MBeans not getting unregistered reliably

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

Adam Wojtuniak resolved ARIES-259.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.1

> MBeans not getting unregistered reliably
> ----------------------------------------
>
>                 Key: ARIES-259
>                 URL: https://issues.apache.org/jira/browse/ARIES-259
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>            Reporter: Thomas Diesler
>            Assignee: Adam Wojtuniak
>             Fix For: 0.1
>
>         Attachments: ARIES-259-20100318.patch
>
>
> Closing the MBeanServiceTracker asyncronously triggers JMXAgent.unregisterBeans(MBeanServer server)
> If there is a unexpected exception while unregistering an MBeanHandler the ones coming after it will not get unregitered.
> In particular I am seeing an unguarded postDeregister hook.
> Caused by: java.lang.IllegalStateException: Invalid BundleContext.
> 	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
> 	at org.apache.felix.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:170)
> 	at org.apache.aries.jmx.framework.BundleState.shutDownDispatcher(BundleState.java:353)
> 	at org.apache.aries.jmx.framework.BundleState.postDeregister(BundleState.java:293)
> 	at org.apache.aries.jmx.framework.RegistrableStandardEmitterMBean.postDeregister(RegistrableStandardEmitterMBean.java:69)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postDeregisterInvoke(DefaultMBeanServerInterceptor.java:1065)

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


[jira] Commented: (ARIES-259) MBeans not getting unregistered reliably

Posted by "Adam Wojtuniak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851623#action_12851623 ] 

Adam Wojtuniak commented on ARIES-259:
--------------------------------------

patch submitted.

Answer to your question:
We decided to use SingleThreadExecutor for better management of MBeans lifecycle. Except framework services the rest is dynamic and
of course MBeanServer which is also registered as a service (for compendium services and MBean server we are using serviceTracker.). 
We are not treating MBeanServer as a static service. So we can't assume that MBean will be registered after jmx bundle is started. 
SingleThreadExecutor perfectly fit in that situation cause we can guarantee sequential order of  MBeans registration and unregistration.   

thanks,
Adam


> MBeans not getting unregistered reliably
> ----------------------------------------
>
>                 Key: ARIES-259
>                 URL: https://issues.apache.org/jira/browse/ARIES-259
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>            Reporter: Thomas Diesler
>            Assignee: Adam Wojtuniak
>             Fix For: 0.1
>
>         Attachments: ARIES-259-20100318.patch
>
>
> Closing the MBeanServiceTracker asyncronously triggers JMXAgent.unregisterBeans(MBeanServer server)
> If there is a unexpected exception while unregistering an MBeanHandler the ones coming after it will not get unregitered.
> In particular I am seeing an unguarded postDeregister hook.
> Caused by: java.lang.IllegalStateException: Invalid BundleContext.
> 	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
> 	at org.apache.felix.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:170)
> 	at org.apache.aries.jmx.framework.BundleState.shutDownDispatcher(BundleState.java:353)
> 	at org.apache.aries.jmx.framework.BundleState.postDeregister(BundleState.java:293)
> 	at org.apache.aries.jmx.framework.RegistrableStandardEmitterMBean.postDeregister(RegistrableStandardEmitterMBean.java:69)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postDeregisterInvoke(DefaultMBeanServerInterceptor.java:1065)

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


[jira] Commented: (ARIES-259) MBeans not getting unregistered reliably

Posted by "Thomas Diesler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847152#action_12847152 ] 

Thomas Diesler commented on ARIES-259:
--------------------------------------

This also pertains to ServiceState and generally to any uncought Exception in the JMXAgent.unregisterBeans(MBeanServer server) loop.

BTW, why is the MBean register/unregister work been done asynchronously. this makes my remote osgi testsuite that delegates to JMX much more complicated.

> MBeans not getting unregistered reliably
> ----------------------------------------
>
>                 Key: ARIES-259
>                 URL: https://issues.apache.org/jira/browse/ARIES-259
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>            Reporter: Thomas Diesler
>         Attachments: ARIES-259-20100318.patch
>
>
> Closing the MBeanServiceTracker asyncronously triggers JMXAgent.unregisterBeans(MBeanServer server)
> If there is a unexpected exception while unregistering an MBeanHandler the ones coming after it will not get unregitered.
> In particular I am seeing an unguarded postDeregister hook.
> Caused by: java.lang.IllegalStateException: Invalid BundleContext.
> 	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
> 	at org.apache.felix.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:170)
> 	at org.apache.aries.jmx.framework.BundleState.shutDownDispatcher(BundleState.java:353)
> 	at org.apache.aries.jmx.framework.BundleState.postDeregister(BundleState.java:293)
> 	at org.apache.aries.jmx.framework.RegistrableStandardEmitterMBean.postDeregister(RegistrableStandardEmitterMBean.java:69)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postDeregisterInvoke(DefaultMBeanServerInterceptor.java:1065)

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


[jira] Assigned: (ARIES-259) MBeans not getting unregistered reliably

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

Adam Wojtuniak reassigned ARIES-259:
------------------------------------

    Assignee: Adam Wojtuniak

> MBeans not getting unregistered reliably
> ----------------------------------------
>
>                 Key: ARIES-259
>                 URL: https://issues.apache.org/jira/browse/ARIES-259
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>            Reporter: Thomas Diesler
>            Assignee: Adam Wojtuniak
>         Attachments: ARIES-259-20100318.patch
>
>
> Closing the MBeanServiceTracker asyncronously triggers JMXAgent.unregisterBeans(MBeanServer server)
> If there is a unexpected exception while unregistering an MBeanHandler the ones coming after it will not get unregitered.
> In particular I am seeing an unguarded postDeregister hook.
> Caused by: java.lang.IllegalStateException: Invalid BundleContext.
> 	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
> 	at org.apache.felix.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:170)
> 	at org.apache.aries.jmx.framework.BundleState.shutDownDispatcher(BundleState.java:353)
> 	at org.apache.aries.jmx.framework.BundleState.postDeregister(BundleState.java:293)
> 	at org.apache.aries.jmx.framework.RegistrableStandardEmitterMBean.postDeregister(RegistrableStandardEmitterMBean.java:69)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postDeregisterInvoke(DefaultMBeanServerInterceptor.java:1065)

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


[jira] Updated: (ARIES-259) MBeans not getting unregistered reliably

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

Thomas Diesler updated ARIES-259:
---------------------------------

    Attachment: ARIES-259-20100318.patch

> MBeans not getting unregistered reliably
> ----------------------------------------
>
>                 Key: ARIES-259
>                 URL: https://issues.apache.org/jira/browse/ARIES-259
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>            Reporter: Thomas Diesler
>         Attachments: ARIES-259-20100318.patch
>
>
> Closing the MBeanServiceTracker asyncronously triggers JMXAgent.unregisterBeans(MBeanServer server)
> If there is a unexpected exception while unregistering an MBeanHandler the ones coming after it will not get unregitered.
> In particular I am seeing an unguarded postDeregister hook.
> Caused by: java.lang.IllegalStateException: Invalid BundleContext.
> 	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
> 	at org.apache.felix.framework.BundleContextImpl.removeBundleListener(BundleContextImpl.java:170)
> 	at org.apache.aries.jmx.framework.BundleState.shutDownDispatcher(BundleState.java:353)
> 	at org.apache.aries.jmx.framework.BundleState.postDeregister(BundleState.java:293)
> 	at org.apache.aries.jmx.framework.RegistrableStandardEmitterMBean.postDeregister(RegistrableStandardEmitterMBean.java:69)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postDeregisterInvoke(DefaultMBeanServerInterceptor.java:1065)

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