Description
When upgrading a broker to 5.16.4, I noticed a NPE during startup. This seems to be caused by an incoming STOMP packet at that time.
Here is what has been logged:
2022-02-28T12:59:33.411+0100 [WrapperSimpleAppMain] INFO BrokerService - Apache ActiveMQ 5.16.4 (broker, broker) started 2022-02-28T12:59:33.411+0100 [WrapperSimpleAppMain] INFO BrokerService - For help or more information please see: http://activemq.apache.org 2022-02-28T12:59:34.084+0100 [ActiveMQ NIO Worker 5] WARN Service - Async error occurred java.lang.NullPointerException at org.apache.activemq.filter.DestinationMapNode.appendMatchingValues(DestinationMapNode.java:238) at org.apache.activemq.filter.DestinationMap.findWildcardMatches(DestinationMap.java:194) at org.apache.activemq.filter.DestinationMap.findWildcardMatches(DestinationMap.java:187) at org.apache.activemq.filter.DestinationMap.unsynchronizedGet(DestinationMap.java:84) at org.apache.activemq.broker.region.AbstractRegion.getDestinations(AbstractRegion.java:327) at org.apache.activemq.broker.region.RegionBroker.getDestinations(RegionBroker.java:176) at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:84) at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:84) at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:84) at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:84) at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:84) at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:84) at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:84) at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:84) at org.apache.activemq.broker.region.virtual.VirtualTopicInterceptor.send(VirtualTopicInterceptor.java:81) at org.apache.activemq.broker.region.virtual.VirtualTopicInterceptor.send(VirtualTopicInterceptor.java:73) at org.apache.activemq.broker.region.DestinationFilter.send(DestinationFilter.java:138) at org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:511) at org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:477) at org.apache.activemq.broker.jmx.ManagedRegionBroker.send(ManagedRegionBroker.java:293) at org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:96) at org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:295) at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:154) at org.apache.activemq.broker.UserIDBroker.send(UserIDBroker.java:60) at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:154) at org.apache.activemq.security.AuthorizationBroker.send(AuthorizationBroker.java:226) at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:154) at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:154) at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:154) at org.apache.activemq.broker.util.TimeStampingBrokerPlugin.send(TimeStampingBrokerPlugin.java:132) at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:154) at org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:580) at org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:769) at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:335) at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:200) at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:45) at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:301) at org.apache.activemq.transport.stomp.StompTransportFilter.sendToActiveMQ(StompTransportFilter.java:97) at org.apache.activemq.transport.stomp.ProtocolConverter.sendToActiveMQ(ProtocolConverter.java:179) at org.apache.activemq.transport.stomp.ProtocolConverter.onStompSend(ProtocolConverter.java:347) at org.apache.activemq.transport.stomp.ProtocolConverter.onStompCommand(ProtocolConverter.java:237) at org.apache.activemq.transport.stomp.StompTransportFilter.onCommand(StompTransportFilter.java:85) at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83) at org.apache.activemq.transport.nio.NIOSSLTransport.doConsume(NIOSSLTransport.java:509) at org.apache.activemq.transport.stomp.StompNIOSSLTransport.doConsume(StompNIOSSLTransport.java:92) at org.apache.activemq.transport.stomp.StompCodec.processCommand(StompCodec.java:133) at org.apache.activemq.transport.stomp.StompCodec.parse(StompCodec.java:119) at org.apache.activemq.transport.stomp.StompNIOSSLTransport.processCommand(StompNIOSSLTransport.java:80) at org.apache.activemq.transport.nio.NIOSSLTransport.serviceRead(NIOSSLTransport.java:284) at org.apache.activemq.transport.nio.NIOSSLTransport$1.onSelect(NIOSSLTransport.java:176) at org.apache.activemq.transport.nio.SelectorSelection.onSelect(SelectorSelection.java:98) at org.apache.activemq.transport.nio.SelectorWorker$1.run(SelectorWorker.java:123) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 2022-02-28T12:59:34.126+0100 [ActiveMQ BrokerService[broker] Task-10] ERROR TaskRunnerFactory - Error in thread 'ActiveMQ BrokerService[broker] Task-10' java.lang.NullPointerException at org.apache.activemq.transport.stomp.StompWireFormat.encodeHeader(StompWireFormat.java:306) at org.apache.activemq.transport.stomp.StompWireFormat.marshalHeaders(StompWireFormat.java:85) at org.apache.activemq.transport.stomp.StompWireFormat.marshal(StompWireFormat.java:106) at org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:193) at org.apache.activemq.transport.stomp.StompTransportFilter.sendToStomp(StompTransportFilter.java:108) at org.apache.activemq.transport.stomp.ProtocolConverter.sendToStomp(ProtocolConverter.java:183) at org.apache.activemq.transport.stomp.ProtocolConverter.handleException(ProtocolConverter.java:316) at org.apache.activemq.transport.stomp.ProtocolConverter.onActiveMQCommand(ProtocolConverter.java:886) at org.apache.activemq.transport.stomp.StompTransportFilter.oneway(StompTransportFilter.java:72) at org.apache.activemq.transport.AbstractInactivityMonitor.doOnewaySend(AbstractInactivityMonitor.java:335) at org.apache.activemq.transport.AbstractInactivityMonitor.oneway(AbstractInactivityMonitor.java:317) at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68) at org.apache.activemq.broker.TransportConnection.dispatch(TransportConnection.java:1483) at org.apache.activemq.broker.TransportConnection.processDispatch(TransportConnection.java:981) at org.apache.activemq.broker.TransportConnection.iterate(TransportConnection.java:1032) at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133) at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
I then restarted the broker once more and this went fine so I cannot reproduce the problem.
I hope that the stack trace is enough to understand what happened.