You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by npenkov <ni...@gmail.com> on 2006/05/23 16:08:18 UTC
NullPointerException in DemandForwarding
In SVN HEAD:
Suppose we have 2 routers - AMQ1 and AMQ2
We use persitent storage.
1. We post messages on AMQ1
2. We consume messages on AMQ2 (Queue is bridged from AMQ1)
Everithing is fine till restarting routers:
Problem:
1. We start AMQ2
2. Post messages
3. Stop AMQ2
4. Start AMQ1
5. Start consumer on AMQ1 (If we don't start it - it will not break)
6. Start AMQ2 (We have already posted 10 test messages and expect to consume
them on AMQ1)
java.lang.NullPointerException
at
org.apache.activemq.network.DemandForwardingBridgeSupport.doCreateDemandSubscription(DemandForwardingBridgeSupport.java:763)
at
org.apache.activemq.network.DemandForwardingBridgeSupport.createDemandSubscription(DemandForwardingBridgeSupport.java:754)
at
org.apache.activemq.network.DemandForwardingBridgeSupport.serviceRemoteConsumerAdvisory(DemandForwardingBridgeSupport.java:355)
at
org.apache.activemq.network.DemandForwardingBridgeSupport.serviceRemoteCommand(DemandForwardingBridgeSupport.java:307)
at
org.apache.activemq.network.DemandForwardingBridgeSupport$2.onCommand(DemandForwardingBridgeSupport.java:124)
at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
at
org.apache.activemq.transport.failover.FailoverTransport$1.onCommand(FailoverTransport.java:105)
at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:114)
at
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:87)
at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:143)
at java.lang.Thread.run(Thread.java:534)
NullPointerException is fired because localSessionInfo in
DemandForwardingBridgeSupport was not created yet. So my sollution is on
line 763 - before:
result.getLocalInfo().setConsumerId(new
ConsumerId(localSessionInfo.getSessionId(),consumerIdGenerator
.getNextSequenceId()));
add:
if(localSessionInfo == null) startLocalBridge();
--
View this message in context: http://www.nabble.com/NullPointerException+in+DemandForwarding-t1669127.html#a4523565
Sent from the ActiveMQ - User forum at Nabble.com.