Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2957

ManagementContext is started twice

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.16.0
    • 2.16.0
    • JMX
    • None

    Description

      ManagementContext isn't guarding from being started twice.

      A recent change on ARTEMIS-2838 has introduced a ActivateCallback::preActivate that's (re)starting the ManagementContext.

      Just guarding against consecutive starts is fixing this, but probably we should start it just once.

      The failing test due to this was org.apache.activemq.artemis.tests.smoke.jmxfailback.JmxFailbackTest#testFailbackOnJMX, with

      jmx-failback1-out:2020-10-20 22:48:46,515 WARN  [org.apache.activemq.artemis.core.server] AMQ222297: Unable to start Management Context, RBAC not available: java.rmi.server.ExportException: internal error: ObjID already in use
      jmx-failback1-out:	at sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:186) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at sun.rmi.transport.Transport.exportObject(Transport.java:106) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:260) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:208) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:152) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:137) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at org.apache.activemq.artemis.core.server.management.RmiRegistryFactory.init(RmiRegistryFactory.java:48) [artemis-server-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.core.server.management.ManagementConnector.start(ManagementConnector.java:54) [artemis-server-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.core.server.management.ManagementContext.start(ManagementContext.java:50) [artemis-server-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.cli.commands.Run$1.preActivate(Run.java:88) [artemis-cli-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.callPreActiveCallbacks(ActiveMQServerImpl.java:2840) [artemis-server-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart1(ActiveMQServerImpl.java:2964) [artemis-server-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.core.server.impl.SharedStoreLiveActivation.run(SharedStoreLiveActivation.java:66) [artemis-server-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:626) [artemis-server-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:550) [artemis-server-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:64) [artemis-cli-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:116) [artemis-cli-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:153) [artemis-cli-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:101) [artemis-cli-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:128) [artemis-cli-2.16.0-SNAPSHOT.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_66]
      jmx-failback1-out:	at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:134) [artemis-boot.jar:2.16.0-SNAPSHOT]
      jmx-failback1-out:	at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:50) [artemis-boot.jar:2.16.0-SNAPSHOT]
      

      Attachments

        Issue Links

          Activity

            People

              nigrofranz Francesco Nigro
              nigrofranz Francesco Nigro
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m