activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQ-6683) NullPointerException on transaction prepare in JdbcMememoryTransactionStore
Date Wed, 07 Jun 2017 11:21:18 GMT

    [ https://issues.apache.org/jira/browse/AMQ-6683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16040724#comment-16040724
] 

Gary Tully commented on AMQ-6683:
---------------------------------

Any chance you can replicate the usage pattern in some test code or maybe with trace=true
on the transport connector broker side such that every command will be logged.

This looks maybe like some contention between add and prepare. Are there multiple connections
involved in a single XA transaction. The TM(aries) will treat them as a single resource based
on the broker id but maybe there is some ordering issue. There is an option to have each connection
represent a separate resource - maybe that would workaround - use "tcp://host:port?jms.rmIdFromConnectionId=true"
on the broker url for your connection factory

> NullPointerException on transaction prepare in JdbcMememoryTransactionStore
> ---------------------------------------------------------------------------
>
>                 Key: AMQ-6683
>                 URL: https://issues.apache.org/jira/browse/AMQ-6683
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, JDBC
>    Affects Versions: 5.14.5
>            Reporter: Jakub
>            Priority: Blocker
>
> From time to time an exception occurs:
> {code}
> Caused by: java.lang.NullPointerException
>                 at org.apache.activemq.store.jdbc.JdbcMemoryTransactionStore.prepare(JdbcMemoryTransactionStore.java:75)
>                 at org.apache.activemq.transaction.XATransaction.prepare(XATransaction.java:188)
>                 at org.apache.activemq.broker.TransactionBroker.prepareTransaction(TransactionBroker.java:247)
>                 at org.apache.activemq.broker.MutableBrokerFilter.prepareTransaction(MutableBrokerFilter.java:133)
>                 at org.apache.activemq.broker.MutableBrokerFilter.prepareTransaction(MutableBrokerFilter.java:133)
>                 at org.apache.activemq.broker.TransportConnection.processPrepareTransaction(TransportConnection.java:519)
>                 at org.apache.activemq.command.TransactionInfo.visit(TransactionInfo.java:98)
>                 at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:336)
>                 at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:200)
>                 at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
>                 at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:125)
>                 at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:301)
>                 at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
>                 at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:233)[47:org.apache.activemq.activemq-osgi:5.14.5]
>                 at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)[47:org.apache.activemq.activemq-osgi:5.14.5]
>                 at java.lang.Thread.run(Thread.java:745)[:1.8.0_131]
> {code}
> On client side there is an exception:
> {code}
> XID:[1197822575,globalId=2c162f175c1006f72672e6170616368652e61726965732e7472616e73616374696f6e0000000000000000000000000000,branchId=2000ffffffe5ffffff8319175c1006170616368652e61726965732e7472616e73616374696f6e0000000000000000000000000000]
failed with: javax.jms.JMSException: java.lang.NullPointerException
> javax.jms.JMSException: java.lang.NullPointerException
>                 at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:54)
>                 at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1399)
>                 at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1428)
>                 at org.apache.activemq.TransactionContext.prepare(TransactionContext.java:469)
>                 at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.prepare(WrapperNamedXAResource.java:86)
>                 at org.apache.geronimo.transaction.manager.TransactionImpl.internalPrepare(TransactionImpl.java:429)
>                 at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:312)
>                 at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252)
>                 at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1020)
>                 at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
>                 at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
>                 at org.apache.aries.transaction.internal.AriesPlatformTransactionManager.commit(AriesPlatformTransactionManager.java:75)
>                 at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:484)
>                 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291)
>                 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
>                 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[90:org.apache.servicemix.bundles.spring-aop:4.2.8.RELEASE_1]
>                 at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
>                 at ...... // custom service
> {code}
> ActiveMQ is configured with jdbc persistence adapter over postgresql:
> {code}
> <bean id="postgres-ds" class="org.apache.commons.dbcp2.BasicDataSource">
>         <property name="url" value="jdbc:postgresql://postgres:5432/activemq" />
>         <property name="connectionProperties" value="[targetServerType=master,readOnly=false]"/>
>         <property name="username" value="abc"/>
>         <property name="password" value="abc"/>
>         <property name="initialSize" value="5" />
>         <property name="maxTotal" value="20" />
>         <property name="maxIdle" value="5" />
>         <property name="validationQuery" value="select 1" />
>         <property name="testWhileIdle" value="true" />
>         <property name="timeBetweenEvictionRunsMillis" value="3000" />
>     </bean>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message