ActiveMQ
  1. ActiveMQ
  2. AMQ-3136

Broker halts web applications on startup if VM brokers try to start from different web applications

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 5.2.0
    • Fix Version/s: None
    • Component/s: Broker, Connector
    • Labels:
      None
    • Environment:

      Java 1.6
      RHEL 5
      Tomcat 6
      Spring 2.5

      Description

      When starting Tomcat with two web applications that both use ActiveMQ VM connector-based brokers, one of the web apps will fail during startup because a VM broker already exists:

      2011-01-13 17:28:40,803 [main] ERROR org.apache.activemq.broker.BrokerService - Failed to start ActiveMQ JMS Message Broker. Reason: javax.management.InstanceAlreadyExistsException: org.apache.activemq:BrokerName=localbroker,Type=Broker
      javax.management.InstanceAlreadyExistsException: org.apache.activemq:BrokerName=localbroker,Type=Broker
      at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
      at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1554)
      at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:540)
      at org.apache.activemq.broker.BrokerService.start(BrokerService.java:444)

      Even if we change the broker name, data directory and VM connector URIs between web apps, we still get this error. It should, ideally, be a flag where the broker can attempt to start a VM instance, and if one exists already, and the flag to use existing VM broker is enabled, the error shouldn't occur but reuse the existing broker. Alternatively, you should be able to have multiple VM brokers created with different names.

      In our case, this broker and messaging service is a convenience to facilitate flushing of caches across a network of servers. In our use case, not being able to do so is not critical. So if something caused the broker to not start, we should be able to still start the application with errors logged but not halting the web application startup. So some parameter there would be helpful as well.

        Activity

        Hide
        Claus Ibsen added a comment -

        Yeah use unique broker names.

        Show
        Claus Ibsen added a comment - Yeah use unique broker names.
        Hide
        Gary Tully added a comment -

        You can provided a broker name other than localhost in the vm url for one of the webapps

        Show
        Gary Tully added a comment - You can provided a broker name other than localhost in the vm url for one of the webapps
        Hide
        jesse crossley added a comment -

        Problem still exists with version 5.4.2

        Show
        jesse crossley added a comment - Problem still exists with version 5.4.2

          People

          • Assignee:
            Unassigned
            Reporter:
            Ryan Shelley
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development