ActiveMQ
  1. ActiveMQ
  2. AMQ-2085

AMQ should not install a JMXConnectorServer for an MBeanServer it does not create

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not A Problem
    • Affects Version/s: 5.3.0
    • Fix Version/s: 5.3.0
    • Component/s: JMX
    • Labels:
      None

      Description

      ManagementContext tends to create a JMXConnectorServer whenever findMBeanServer is called. This seems like really wrong behavior – amq should not be setting up jmx remoting on mbean servers it hasn't created, certainly not as a side effect of something like creating a vm transport connection:

      createConnector():365, ManagementContext.java
      findMBeanServer():293, ManagementContext.java
      getMBeanServer():148, ManagementContext.java
      start():77, ManagementContext.java
      start():458, BrokerService.java
      doCompositeConnect():123, VMTransportFactory.java
      doConnect():53, VMTransportFactory.java
      doConnect():51, TransportFactory.java
      connect():80, TransportFactory.java
      createTransport():239, ActiveMQConnectionFactory.java
      createActiveMQConnection():254, ActiveMQConnectionFactory.java
      createConnection():181, ActiveMQConnectionFactory.java
      makeConnection():79, ActiveMQConnectionSupport.java
      makeConnection():61, ActiveMQConnectionSupport.java
      createManagedConnection():169, ActiveMQManagedConnectionFactory.java

        Activity

        Hide
        David Jencks added a comment -

        Fixed rev 737951.... please note any problems this might cause.

        Show
        David Jencks added a comment - Fixed rev 737951.... please note any problems this might cause.
        Hide
        Dejan Bosanac added a comment -

        Enabled finding Tiger MBean server by default (and creating a connector for it), since it was breaking the standalone broker functionality. I think it should be fine now, since it will not create a connector for any other server. The change is committed in revision 745833. Please let me know if this still works for you.

        Show
        Dejan Bosanac added a comment - Enabled finding Tiger MBean server by default (and creating a connector for it), since it was breaking the standalone broker functionality. I think it should be fine now, since it will not create a connector for any other server. The change is committed in revision 745833. Please let me know if this still works for you.
        Hide
        Phil Pickett added a comment -

        I'm seeing some different behavior between a webapp with an embedded broker deployed to JBoss and am suspicious that what I see may be related to these changes. With ActiveMQ 5.3 and the web demo chat application, I don't see the org.apache.activemq MBeans in the JBoss jmx-console but with the ActiveMQ 5.2 version I do.

        I'm bundling up the ActiveMQ demo webapps as two war files, demo52.war and demo53.war. At first I used the 5.2 jars for the 5.2 webapp and the 5.3 jars for the 5.3 webapp. To only vary one thing, I changed this so that each bundles the ActiveMQ 5.3 activemq-web-5.3.0.jar, camel-core-2.0.0.jar, and jetty-util-6.1.9.jar. The difference is that demo5.2 bundles activemq-core-5.2.0.jar and demo53.war bundles activemq-core-5.3.0.jar.

        When I deploy demo52.war to JBoss, open a browser to the app at URI http://localhost:8280/demo52/chat.html, and enter a username, I see the messages in the JBoss log:

        11:07:34,485 INFO [TomcatDeployer] deploy, ctxPath=/demo52, warUrl=.../tmp/deploy/tmp8966298452211694373demo52-exp.war/
        11:07:56,779 INFO [BrokerService] Using Persistence Adapter: AMQPersistenceAdapter(activemq-data\localhost)
        11:07:56,781 INFO [AMQPersistenceAdapter] AMQStore starting using directory: activemq-data\localhost
        11:07:56,820 INFO [KahaStore] Kaha Store using data directory activemq-data\localhost\kr-store\state
        11:07:56,891 INFO [AMQPersistenceAdapter] Active data files: []
        11:07:56,980 INFO [BrokerService] ActiveMQ 5.2.0 JMS Message Broker (localhost) is starting
        11:07:56,981 INFO [BrokerService] For help or more information please see: http://activemq.apache.org/
        11:07:56,988 INFO [ManagementContext] JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
        11:07:57,185 INFO [KahaStore] Kaha Store using data directory activemq-data\localhost\kr-store\data
        11:07:57,293 INFO [BrokerService] ActiveMQ JMS Message Broker (localhost, ID:ppickett-PC-64367-1272388077023-0:0) started
        11:07:57,304 INFO [TransportConnector] Connector vm://localhost Started

        and also see the org.apache.activemq MBeans on the JBoss jmx-console at http://localhost:8280/jmx-console/

        When I undeploy the demo52.war and deploy demo53.war, open a browser to http://localhost:8280/demo53/chat.html, and enter a username, I see similar messages in the JBoss log:

        11:11:18,962 INFO [TomcatDeployer] deploy, ctxPath=/demo53, warUrl=.../tmp/deploy/tmp8938444770518177909demo53-exp.war/
        11:11:35,950 INFO [BrokerService] Using Persistence Adapter: AMQPersistenceAdapter(activemq-data\localhost)
        11:11:35,952 INFO [AMQPersistenceAdapter] AMQStore starting using directory: activemq-data\localhost
        11:11:35,989 INFO [KahaStore] Kaha Store using data directory activemq-data\localhost\kr-store\state
        11:11:36,060 INFO [AMQPersistenceAdapter] Active data files: []
        11:11:36,125 INFO [BrokerService] ActiveMQ 5.3.0 JMS Message Broker (localhost) is starting
        11:11:36,125 INFO [BrokerService] For help or more information please see: http://activemq.apache.org/
        11:11:36,333 INFO [KahaStore] Kaha Store using data directory activemq-data\localhost\kr-store\data
        11:11:36,485 INFO [ManagementContext] JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
        11:11:36,490 INFO [BrokerService] ActiveMQ JMS Message Broker (localhost, ID:ppickett-PC-64379-1272388296166-0:0) started
        11:11:36,501 INFO [TransportConnector] Connector vm://localhost Started

        but with the demo53.war, no org.apache.activemq MBeans are shown on the JBoss jmx-console.

        Any ideas on this?

        Thanks,

        Phil

        Show
        Phil Pickett added a comment - I'm seeing some different behavior between a webapp with an embedded broker deployed to JBoss and am suspicious that what I see may be related to these changes. With ActiveMQ 5.3 and the web demo chat application, I don't see the org.apache.activemq MBeans in the JBoss jmx-console but with the ActiveMQ 5.2 version I do. I'm bundling up the ActiveMQ demo webapps as two war files, demo52.war and demo53.war. At first I used the 5.2 jars for the 5.2 webapp and the 5.3 jars for the 5.3 webapp. To only vary one thing, I changed this so that each bundles the ActiveMQ 5.3 activemq-web-5.3.0.jar, camel-core-2.0.0.jar, and jetty-util-6.1.9.jar. The difference is that demo5.2 bundles activemq-core-5.2.0.jar and demo53.war bundles activemq-core-5.3.0.jar. When I deploy demo52.war to JBoss, open a browser to the app at URI http://localhost:8280/demo52/chat.html , and enter a username, I see the messages in the JBoss log: 11:07:34,485 INFO [TomcatDeployer] deploy, ctxPath=/demo52, warUrl=.../tmp/deploy/tmp8966298452211694373demo52-exp.war/ 11:07:56,779 INFO [BrokerService] Using Persistence Adapter: AMQPersistenceAdapter(activemq-data\localhost) 11:07:56,781 INFO [AMQPersistenceAdapter] AMQStore starting using directory: activemq-data\localhost 11:07:56,820 INFO [KahaStore] Kaha Store using data directory activemq-data\localhost\kr-store\state 11:07:56,891 INFO [AMQPersistenceAdapter] Active data files: [] 11:07:56,980 INFO [BrokerService] ActiveMQ 5.2.0 JMS Message Broker (localhost) is starting 11:07:56,981 INFO [BrokerService] For help or more information please see: http://activemq.apache.org/ 11:07:56,988 INFO [ManagementContext] JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi 11:07:57,185 INFO [KahaStore] Kaha Store using data directory activemq-data\localhost\kr-store\data 11:07:57,293 INFO [BrokerService] ActiveMQ JMS Message Broker (localhost, ID:ppickett-PC-64367-1272388077023-0:0) started 11:07:57,304 INFO [TransportConnector] Connector vm://localhost Started and also see the org.apache.activemq MBeans on the JBoss jmx-console at http://localhost:8280/jmx-console/ When I undeploy the demo52.war and deploy demo53.war, open a browser to http://localhost:8280/demo53/chat.html , and enter a username, I see similar messages in the JBoss log: 11:11:18,962 INFO [TomcatDeployer] deploy, ctxPath=/demo53, warUrl=.../tmp/deploy/tmp8938444770518177909demo53-exp.war/ 11:11:35,950 INFO [BrokerService] Using Persistence Adapter: AMQPersistenceAdapter(activemq-data\localhost) 11:11:35,952 INFO [AMQPersistenceAdapter] AMQStore starting using directory: activemq-data\localhost 11:11:35,989 INFO [KahaStore] Kaha Store using data directory activemq-data\localhost\kr-store\state 11:11:36,060 INFO [AMQPersistenceAdapter] Active data files: [] 11:11:36,125 INFO [BrokerService] ActiveMQ 5.3.0 JMS Message Broker (localhost) is starting 11:11:36,125 INFO [BrokerService] For help or more information please see: http://activemq.apache.org/ 11:11:36,333 INFO [KahaStore] Kaha Store using data directory activemq-data\localhost\kr-store\data 11:11:36,485 INFO [ManagementContext] JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi 11:11:36,490 INFO [BrokerService] ActiveMQ JMS Message Broker (localhost, ID:ppickett-PC-64379-1272388296166-0:0) started 11:11:36,501 INFO [TransportConnector] Connector vm://localhost Started but with the demo53.war, no org.apache.activemq MBeans are shown on the JBoss jmx-console. Any ideas on this? Thanks, Phil
        Hide
        Phil Pickett added a comment -

        I'm not sure if there is a workaround, but this change appears to have caused the issue with org.apache.activemq MBeans no longer appearing in the JBoss jmx-console for an app with an embedded broker. I created a simple jar containing the ManagementContext.class with the changes associated with this Jira. With the AMQ 5.2 core jar in the webapp, the MBeans appear in the jmx-console. When the modified version of this class is included in the app, the MBeans no longer appear.

        Show
        Phil Pickett added a comment - I'm not sure if there is a workaround, but this change appears to have caused the issue with org.apache.activemq MBeans no longer appearing in the JBoss jmx-console for an app with an embedded broker. I created a simple jar containing the ManagementContext.class with the changes associated with this Jira. With the AMQ 5.2 core jar in the webapp, the MBeans appear in the jmx-console. When the modified version of this class is included in the app, the MBeans no longer appear.
        Hide
        Timothy Bish added a comment -

        The workaround for the JBoss issue is to set findTigerMBeanServer to false.

        Show
        Timothy Bish added a comment - The workaround for the JBoss issue is to set findTigerMBeanServer to false.

          People

          • Assignee:
            David Jencks
            Reporter:
            David Jencks
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development