activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (AMQ-4507) FailoverTransport throws NullPointerException
Date Thu, 02 May 2013 13:06:16 GMT

     [ https://issues.apache.org/jira/browse/AMQ-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gary Tully resolved AMQ-4507.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 5.9.0
         Assignee: Gary Tully

fix applied with thanks in http://svn.apache.org/r1478357
                
> FailoverTransport throws NullPointerException
> ---------------------------------------------
>
>                 Key: AMQ-4507
>                 URL: https://issues.apache.org/jira/browse/AMQ-4507
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Transport
>    Affects Versions: 5.8.0
>         Environment: Win 7, java 7
>            Reporter: Thomas G√ľnter
>            Assignee: Gary Tully
>            Priority: Minor
>              Labels: patch
>             Fix For: 5.9.0
>
>
> The Failovertransport throws NullPointer Exceptions in case of a failover to another
primary host for the following broker url:
> {{failover:(tcp://primary_1:61616,tcp://primary_2:61616,tcp://secondary_1:61616,tcp://secondary_2:61616)?randomize=false&priorityBackup=true&priorityURIs=tcp://primary_1:61616,tcp://primary_2:61616&jms.alwaysSyncSend=true}}
> Stack trace:
> Exception in thread "ActiveMQ Task-2" java.lang.NullPointerException
> 	at org.apache.activemq.transport.failover.FailoverTransport.disposeTransport(FailoverTransport.java:231)
> 	at org.apache.activemq.transport.failover.FailoverTransport.doReconnect(FailoverTransport.java:954)
> 	at org.apache.activemq.transport.failover.FailoverTransport$2.iterate(FailoverTransport.java:143)
> 	at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)
> 	at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:722)
> I assume that this is a copy-paste bug, since in the current revision (1478184, see link
below) of the FailoverTransport on line #966, the variable 'old' should be checked for null
instead of 'transport'. However, I have no clue why 'old' is null even though the transport
was handling messages before the failover.
> [http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java?revision=1478184&view=markup]
> Current code:
> 955 Transport old = this.connectedTransport.getAndSet(null);
> 966 if (transport != null) \{
> 967   disposeTransport(old);
> 968 \}
> Corrected code:
> 955 Transport old = this.connectedTransport.getAndSet(null);
> 966 if (old!= null) \{
> 967   disposeTransport(old);
> 968 \}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message