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
- is caused by
-
ARTEMIS-2838 Migrate Console to use Hawtio 2
- Closed
- links to