Description
ARTEMIS-3117 introduced code in 2.18.0 to invoke OpenSSLContextFactoryProvider.getOpenSSLContextFactory().clearSslContexts(); during stop of RemotingServiceImpl. See below for whole stacktrace.
This throws a NullPointerException for us running inside Karaf on stop due to the OpenSSLContextFactory being null at that point in time.
ARTEMIS-2791 was somewhat similar to this.
Requesting to not fail on the OpenSSLContextFactory being null during stop.
{code:java} INFO org.apache.activemq.artemis.osgi FelixStartLevel [org.apache.activemq.artemis-server-osgi:2.18.0.SEE1] AMQ581002: Required protocol OPENWIRE was removed for broker local. Stopping broker. INFO org.apache.activemq.artemis.osgi FelixStartLevel [org.apache.activemq.artemis-server-osgi:2.18.0.SEE1] AMQ581002: Required protocol OPENWIRE was removed for broker local. Stopping broker. ERROR org.apache.activemq.artemis.core.server FelixStartLevel [org.apache.activemq.artemis-server-osgi:2.18.0.SEE1] AMQ224068: Unable to stop component: org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpljava.lang.ExceptionInInitializerError: null at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl.stop(RemotingServiceImpl.java:390) ~[?:?] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1287) ~[?:?] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1153) ~[?:?] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1137) ~[?:?] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:948) ~[?:?] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:942) ~[?:?] at org.apache.activemq.artemis.osgi.OsgiBroker$ServerTrackerCallBackImpl.stop(OsgiBroker.java:242) ~[?:?] at org.apache.activemq.artemis.osgi.ProtocolTracker.protocolRemoved(ProtocolTracker.java:122) ~[?:?] at org.apache.activemq.artemis.osgi.ProtocolTracker.removedService(ProtocolTracker.java:94) ~[?:?] at org.apache.activemq.artemis.osgi.ProtocolTracker.removedService(ProtocolTracker.java:38) ~[?:?] at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:969) ~[osgi.core-7.0.0.jar:?] at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:871) ~[osgi.core-7.0.0.jar:?] at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341) ~[osgi.core-7.0.0.jar:?] at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:380) ~[osgi.core-7.0.0.jar:?] at org.apache.activemq.artemis.osgi.OsgiBroker.stop(OsgiBroker.java:147) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:244) ~[?:?] at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) ~[?:?] at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:685) ~[?:?] at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:529) ~[?:?] at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:318) ~[?:?] at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:308) ~[?:?] at org.apache.felix.scr.impl.manager.SingleComponentManager.disposeImplementationObject(SingleComponentManager.java:421) ~[?:?] at org.apache.felix.scr.impl.manager.SingleComponentManager.deleteComponent(SingleComponentManager.java:165) ~[?:?] at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:853) ~[?:?] at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:825) ~[?:?] at org.apache.felix.scr.impl.manager.AbstractComponentManager.dispose(AbstractComponentManager.java:589) ~[?:?] at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.disposeComponents(ConfigurableComponentHolder.java:718) ~[?:?] at org.apache.felix.scr.impl.BundleComponentActivator.dispose(BundleComponentActivator.java:487) ~[?:?] at org.apache.felix.scr.impl.Activator.disposeComponents(Activator.java:613) ~[?:?] at org.apache.felix.scr.impl.Activator.access$300(Activator.java:70) ~[?:?] at org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:451) ~[?:?] at org.apache.felix.scr.impl.AbstractExtender$1.run(AbstractExtender.java:216) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at org.apache.felix.scr.impl.AbstractExtender.destroyExtension(AbstractExtender.java:238) ~[?:?] at org.apache.felix.scr.impl.AbstractExtender.bundleChanged(AbstractExtender.java:132) ~[?:?] at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:217) ~[?:?] at org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915) ~[?:?] at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834) ~[?:?] at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516) ~[?:?] at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4817) ~[?:?] at org.apache.felix.framework.Felix.stopBundle(Felix.java:2785) ~[?:?] at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1557) ~[?:?] at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) ~[?:?] at java.lang.Thread.run(Thread.java:829) [?:?]Caused by: java.lang.IllegalStateException: No OpenSSLContextFactory registered! at org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactoryProvider.<clinit>(OpenSSLContextFactoryProvider.java:35) ~[?:?] ... 49 moreWARN org.apache.activemq.artemis.core.server FelixStartLevel [org.apache.activemq.artemis-server-osgi:2.18.0.SEE1] AMQ222113: On ManagementService stop, there are 2 unexpected registered MBeans: [acceptor.in-vm, acceptor.artemis]INFO org.apache.activemq.artemis.core.server FelixStartLevel [org.apache.activemq.artemis-server-osgi:2.18.0.SEE1] AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.18.0.SEE1 [012b41d2-0048-11ec-8dcc-fa163ea0a26e] stopped, uptime 7 minutes