activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bobby_carp <amqfo...@thecarps.net>
Subject Transaction rolled back during removeMessage "No operations allowed after statement closed"
Date Mon, 05 May 2014 20:57:52 GMT
I am running into sporadic failures of ActiveMQ when my message handler is
handling a message.  ActiveMQ is trying to remove the message, but gets SQL
exception from MySQL about "No operations allowed after statement closed". 
It seems like it is related to a bad/failed connection to MySQL, but MySQL
is definitely up and running and my handler code successfully used Hibernate
to persist an entity right before this failure in trying to remove the JMS
message.

I am doing a very straight-forward use case, running under Apache Tomcat 7
with MySQL 5.5.  Here is the stack crawl from the exception.

Any help is appreciated!

2014-05-03 18:03:30,379 WARN
[org.springframework.jms.listener.DefaultMessageListenerContainer#0-6]
DefaultMessageListenerContainer.invokeErrorHandler(696) | Execution of JMS
message listener failed, and no ErrorHandler has been set.
javax.jms.JMSException: STORE COMMIT FAILED: Transaction rolled back
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:54)
        at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1405)
        at
org.apache.activemq.TransactionContext.syncSendPacketWithInterruptionHandling(TransactionContext.java:757)
        at
org.apache.activemq.TransactionContext.commit(TransactionContext.java:322)
        at
org.apache.activemq.ActiveMQSession.commit(ActiveMQSession.java:562)
        at
org.apache.activemq.jms.pool.PooledSession.commit(PooledSession.java:162)
        at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at
org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:348)
        at com.sun.proxy.$Proxy89.commit(Unknown Source)
        at
org.springframework.jms.support.JmsUtils.commitIfNecessary(JmsUtils.java:217)
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.commitIfNecessary(AbstractMessageListenerContainer.java:577)
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:482)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1103)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1095)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:992)
        at java.lang.Thread.run(Thread.java:744)
Caused by: javax.transaction.xa.XAException: STORE COMMIT FAILED:
Transaction rolled back
        at
org.apache.activemq.transaction.LocalTransaction.commit(LocalTransaction.java:75)
        at
org.apache.activemq.broker.TransactionBroker.commitTransaction(TransactionBroker.java:253)
        at
org.apache.activemq.broker.MutableBrokerFilter.commitTransaction(MutableBrokerFilter.java:112)
        at
org.apache.activemq.broker.TransportConnection.processCommitTransactionOnePhase(TransportConnection.java:424)
        at
org.apache.activemq.command.TransactionInfo.visit(TransactionInfo.java:100)
        at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
        at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:149)
        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)
        ... 1 more
Caused by: java.io.IOException: Failed to get store sequenceId for
messageId: ID:ip-172-31-12-248-58664-1398142500942-1:1:5:1:5, on:
queue://incoming.queue. Reason:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No
operations allowed after statement closed.
        at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getStoreSequenceIdForMessageId(JDBCPersistenceAdapter.java:843)
        at
org.apache.activemq.store.jdbc.JDBCMessageStore.removeMessage(JDBCMessageStore.java:194)
        at
org.apache.activemq.store.memory.MemoryTransactionStore$4.run(MemoryTransactionStore.java:348)
        at
org.apache.activemq.store.memory.MemoryTransactionStore$Tx.commit(MemoryTransactionStore.java:103)
        at
org.apache.activemq.store.memory.MemoryTransactionStore.commit(MemoryTransactionStore.java:259)
        at
org.apache.activemq.transaction.LocalTransaction.commit(LocalTransaction.java:70)
        ... 13 more
Caused by:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No
operations allowed after statement closed.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
        at com.mysql.jdbc.StatementImpl.checkClosed(StatementImpl.java:458)
        at
com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:4410)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:135)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:135)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:135)
        at
org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.getStoreSequenceId(DefaultJDBCAdapter.java:291)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getStoreSequenceIdForMessageId(JDBCPersistenceAdapter.java:840)
        ... 18 more




--
View this message in context: http://activemq.2283324.n4.nabble.com/Transaction-rolled-back-during-removeMessage-No-operations-allowed-after-statement-closed-tp4680905.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Mime
View raw message