You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2012/09/08 11:47:07 UTC

[jira] [Commented] (AMQ-3807) MBeans are not unregistered under WebSphere

    [ https://issues.apache.org/jira/browse/AMQ-3807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451294#comment-13451294 ] 

Claus Ibsen commented on AMQ-3807:
----------------------------------

Thanks for reporting.
                
> MBeans are not unregistered under WebSphere
> -------------------------------------------
>
>                 Key: AMQ-3807
>                 URL: https://issues.apache.org/jira/browse/AMQ-3807
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, JMX
>         Environment: WebSphere 7
>            Reporter: christian ohr
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 5.7.0
>
>         Attachments: ManagementContext.patch
>
>
> When running ActiveMQ in embedded mode under WebSphere (I know that this is not a typical JEE-compliant deployment)  the ObjectNames of the registered MBeans are modified by the container. Unfortunately, ActiveMQ fails to keep these names. As a result, ActiveMQ does not unregister its beans when an application is stopped, and a restart causes InstanceAlreadyExistExceptions.
> The following change to ManagementContext.java may help:
> Currently:
> {code}
> public ObjectInstance registerMBean(Object bean, ObjectName name) throws Exception {
>         ObjectInstance result = getMBeanServer().registerMBean(bean, name);
>         this.registeredMBeanNames.add(name);
>         return result;
>     }
> {code}
> but it should be something like:
> {code}
> public ObjectInstance registerMBean(Object bean, ObjectName name) throws Exception {
>         ObjectInstance result = getMBeanServer().registerMBean(bean, name);
>         if (result != null) this.registeredMBeanNames.add(result.getObjectName);
>         return result;
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira