Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 46160 invoked from network); 1 Jul 2008 21:24:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jul 2008 21:24:51 -0000 Received: (qmail 74896 invoked by uid 500); 1 Jul 2008 21:24:52 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 74872 invoked by uid 500); 1 Jul 2008 21:24:52 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 74861 invoked by uid 99); 1 Jul 2008 21:24:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2008 14:24:52 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2008 21:24:09 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 59FA4234C14E for ; Tue, 1 Jul 2008 14:24:00 -0700 (PDT) Message-ID: <326184633.1214947440367.JavaMail.jira@brutus> Date: Tue, 1 Jul 2008 14:24:00 -0700 (PDT) From: "Hans Bausewein (JIRA)" To: dev@activemq.apache.org Subject: [jira] Issue Comment Edited: (AMQ-1719) Resource adapter stops consuming messages after broker is forcefully stopped/restarted during XA transaction. In-Reply-To: <531615870.1210596463454.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43848#action_43848 ] hansb edited comment on AMQ-1719 at 7/1/08 2:23 PM: ------------------------------------------------------------- The NullPointerException occurs at the last line of the 'run()' method of RemoveTransactionAction: {code:title=ConnectionStateTracker.java|borderStyle=solid} private class RemoveTransactionAction implements Runnable { private final TransactionInfo info; public RemoveTransactionAction(TransactionInfo info) { this.info = info; } public void run() { ConnectionId connectionId = info.getConnectionId(); ConnectionState cs = connectionStates.get(connectionId); cs.removeTransactionState(info.getTransactionId()); } } {code} Apparently there is no ConnectionState for "connectionId" (anymore). "removeTransactionState" removes the TransactionState identified by "transactionId" from a local Map, but since ConnectionState does not exist anymore, this is bogus. The NullPointerException itself is not a problem, but can be avoided by putting an "if (cs != null) {} the last statement. The problem probably existed already. was (Author: hansb): The NullPointerException occurs at the last line of the 'run()' method of RemoveTransactionAction: private class RemoveTransactionAction implements Runnable { private final TransactionInfo info; public RemoveTransactionAction(TransactionInfo info) { this.info = info; } public void run() { ConnectionId connectionId = info.getConnectionId(); ConnectionState cs = connectionStates.get(connectionId); cs.removeTransactionState(info.getTransactionId()); } } Apparently there is no ConnectionState for "connectionId" (anymore). "removeTransactionState" removes the TransactionState identified by "transactionId" from a local Map, but since ConnectionState does not exist anymore, this is bogus. The NullPointerException itself is not a problem, but can be avoided by putting an "if (cs != null) {} the last statement. The problem probably existed already. > Resource adapter stops consuming messages after broker is forcefully stopped/restarted during XA transaction. > ------------------------------------------------------------------------------------------------------------- > > Key: AMQ-1719 > URL: https://issues.apache.org/activemq/browse/AMQ-1719 > Project: ActiveMQ > Issue Type: Bug > Components: Broker, Connector > Affects Versions: 5.1.0 > Environment: Windows XP, IBM WebSphere 6.1.0.15, Oracle 10.2.0.3, Java 1.5.0 ( IBM J9 VM), ActiveMQ 5.1.0 downloaded 2008-May-12. > Reporter: Johan Ekesparr > Attachments: apache-activemq-5.1.0_data.tar.zip, DemoEAR.ear, websphere_trace.log > > > Have attached logs from websphere, activeMQ and also the content of the datadirectory for details of data state ( plus the smal program used to create the scenario). > #1. Installed the resource adapter that came with ActiveMQ into the websperhe applicationserver and configured it to connect to external broker using failover. > #2. Setup a JDBC XA datasource ( Oracle ) and JMS XA destination ( ActiveMQ ). > #3. Created a small Message Driven bean that receives a JMS message that it tries to store in the database after which it sleeps for 5 secs. And deployed it to the WebSphere appserver. > #4. Started the activemq broker without doing any modifications since the download and extract into the filesystem. > #5. Started applicationserver. > #6. Started publishing messages to the broker > #7. As expected the Message driven bean received the messages one-by-one and processed them. > #8. Used to ctrl-C on the broker to halt it in the middle of the processing. Resulting in a failed commit of XA transaction. > #9. Waited a while and then started broker again. > #10. Received Exception on client side and nothing more happened. > Exception in thread "ActiveMQ Transport: tcp://localhost/127.0.0.1:61616" java.lang.NullPointerException > at org.apache.activemq.state.ConnectionStateTracker$RemoveTransactionAction.run(ConnectionStateTracker.java:84) > at org.apache.activemq.state.Tracked.onResponses(Tracked.java:31) > at org.apache.activemq.transport.failover.FailoverTransport$3.onCommand(FailoverTransport.java:148) > at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:143) > at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:206) > at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84) > at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:196) > at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183) > at java.lang.Thread.run(Thread.java:801) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.