Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-3807

MBeans are not unregistered under WebSphere

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.7.0
    • Component/s: Broker, JMX
    • Labels:
      None
    • Environment:

      WebSphere 7

    • Patch Info:
      Patch Available

      Description

      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:

      public ObjectInstance registerMBean(Object bean, ObjectName name) throws Exception {
              ObjectInstance result = getMBeanServer().registerMBean(bean, name);
              this.registeredMBeanNames.add(name);
              return result;
          }
      

      but it should be something like:

      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;
          }
      

        Attachments

        1. ManagementContext.patch
          3 kB
          christian ohr

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              christian.ohr christian ohr
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: