activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ron Koerner (JIRA)" <>
Subject [jira] [Commented] (AMQ-3887) Occasional Null Pointer Exception during NetworkConnector connection
Date Wed, 18 Jul 2012 11:38:34 GMT


Ron Koerner commented on AMQ-3887:

I tried, but it seems the problem only manifests in a live system.
Anyway, I think it is a race condition introduced by the following facts

* {{DemandForwardingBridgeSupport.start}}
** synchronously connects the {{local/remoteBroker}} Transports to {{serviceLocal/RemoteCommand}}
** asynchronously runs {{startRemoteBride}}
* someone sends a messageDispatch command to {{localBroker}} (whenever, maybe even before
* {{\[BrokerService[smcufs02] Task-147\] }} delivers the message after {{DemandForwardingBridgeSupport.start}}

** to {{DemandForwardingBridgeSupport.serviceLocalCommand}}
** which calls {{configureMessage}} which uses {{producerInfo}} which is not yet set
** and {{startLocalBridge}} may not even be started yet
* {{startRemoteBridge}}
** eventually creates {{producerInfo}}

I don't think {{serviceLocalCommand}} should handle message dispatches before the bridge is
completely started. Therefore a {{waitStarted()}} after {{if (command.isMessageDispatch())}}
in {{serviceLocalCommand}} should solve the problem.

It is to note that {{serviceRemoteCommand}} already includes a {{waitStarted()}} for message

Maybe both methods should make a checked for {{disposed}} after waiting. They do check at
the beginning, but if {{waitStarted}} really blocks, that may change in the meantime.

> Occasional Null Pointer Exception during NetworkConnector connection
> --------------------------------------------------------------------
>                 Key: AMQ-3887
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.6.0
>         Environment: SLES 10
>            Reporter: Ron Koerner
>            Assignee: Timothy Bish
>             Fix For: 5.7.0
> While starting a duplex NetworkConnector an NPE can be observed on the receiving side.
> {code}
> 2012-06-18 17:34:24,571 INFO  .DemandForwardingBridgeSupport - Network connection between
vm://proxy-cbpi001#8 and tcp:///169.254.
> 0.5:59412(cbox-56BU101117) has been established. [StartLocalBridge: localBroker=vm://proxy-cbpi001#8]
> 2012-06-18 17:34:24,577 WARN  .DemandForwardingBridgeSupport - Caught an exception processing
local command [BrokerService[proxy-c
> bpi001] Task-19]
> java.lang.NullPointerException: null
>         at
> tivemq-core-5.6.0.jar:5.6.0]
>         at
> [activemq-core-5.6.0.jar:5.6.0]
>         at$1.onCommand(
> -core-5.6.0.jar:5.6.0]
>         at org.apache.activemq.transport.ResponseCorrelator.onCommand(
>         at org.apache.activemq.transport.MutexTransport.onCommand(
>         at org.apache.activemq.transport.vm.VMTransport.doDispatch(
>         at org.apache.activemq.transport.vm.VMTransport.dispatch(
>         at org.apache.activemq.transport.vm.VMTransport.oneway(
>         at org.apache.activemq.transport.MutexTransport.oneway(
>         at org.apache.activemq.transport.ResponseCorrelator.oneway(
>         at
>         at
> .6.0]
>         at
>         at org.apache.activemq.thread.PooledTaskRunner.runTask(
>         at org.apache.activemq.thread.PooledTaskRunner$
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [na:1.6.0_20]
>         at java.util.concurrent.ThreadPoolExecutor$ Source) [na:1.6.0_20]
>         at Source) [na:1.6.0_20]
> {code}
> The other broker will eventually connect, but with about a hundred of connecting brokers
this occurs too often to ignore.
> As this seems to be a race condition it is quite difficult to reproduce reliably. I assume
producerInfo is accessed in configureMessage before it is initialized in startRemoteBridge.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message