I noticed that *my* tests fail but also that some of the ActiveMQ tests
were “failing” with this exception (below).

This is because context is null (which is odd).

            boolean originalFlowControl = context.isProducerFlowControl();
            final ProducerBrokerExchange producerExchange = new
ProducerBrokerExchange();
            producerExchange.setConnectionContext(context);
            producerExchange.setMutable(true);
            producerExchange.setProducerState(new ProducerState(new
ProducerInfo()));

What’s alarming about this is that there are two problems:

1.  We’re silently swallowing this exception and just not delivering the
advisory.
2.  We’re not actually printing the full stack trace, just the name of the
class of the Exception.  In this case NullPointerException.

…

So I suspect that we don’t have tests to verify that advisories are
actually being delivered (because current tests don’t find this issue) and
that we’re silently failing here.

Should we print the full stack trace? I think we should.

I think this is one of the reasons I’d like to see ActiveMQ go for more of
a continuous integration strategy and faster tests.  This way we could have
found out EXACTLY which revision introduce this bug.


java.lang.NullPointerException
at
org.apache.activemq.advisory.AdvisoryBroker.fireAdvisory(AdvisoryBroker.java:626)
at
org.apache.activemq.advisory.AdvisoryBroker.messageDelivered(AdvisoryBroker.java:397)
at
org.apache.activemq.broker.BrokerFilter.messageDelivered(BrokerFilter.java:349)
at
org.apache.activemq.broker.BrokerFilter.messageDelivered(BrokerFilter.java:349)
at
org.apache.activemq.broker.MutableBrokerFilter.messageDelivered(MutableBrokerFilter.java:360)
at
org.apache.activemq.broker.MutableBrokerFilter.messageDelivered(MutableBrokerFilter.java:360)
at
org.apache.activemq.broker.region.BaseDestination.messageDelivered(BaseDestination.java:518)
at org.apache.activemq.broker.region.Queue.messageSent(Queue.java:1806)
at
org.apache.activemq.broker.region.Queue.doPendingCursorAdditions(Queue.java:794)
at org.apache.activemq.broker.region.Queue.orderedCursorAdd(Queue.java:875)
at org.apache.activemq.broker.region.Queue.doMessageSend(Queue.java:854)
at org.apache.activemq.broker.region.Queue.send(Queue.java:733)
at
org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:419)
at
org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:468)
at
org.apache.activemq.broker.jmx.ManagedRegionBroker.send(ManagedRegionBroker.java:297)
at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:152)
at
org.apache.activemq.broker.scheduler.SchedulerBroker.send(SchedulerBroker.java:169)
at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:152)
at
org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:96)
at
org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:307)
at
org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:157)
at
org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:157)
at
org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:541)
at
org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:768)
at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:334)
at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:188)
at
org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
at
org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:270)
at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
at java.lang.Thread.run(Thread.java:724)

-- 

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>
<http://spinn3r.com>

Reply via email to