Atomikos Forum

JMS AtomikosConnectionFactoryBean not removing stale connections

Hi,
  I am using atomikos version 3.7.1 with for setting up XA transactions on Apache activemq. I have observed that 'com.atomikos.jms.AtomikosConnectionFactoryBean' does not remove the stale connections from the pool, hence it returns stale connections which leads to the following exception "org.apache.activemq.ConnectionFailedException: The JMS connection has failed: java.io.EOFException". Has anybody encountered the same problem or am I doing something wrong. Any help will be much appreciated.

My configurations are as follows,

    <bean id="xaFactory" class="org.apache.activemq.ActiveMQXAConnectionFactory">
        <property name="brokerURL" value="${broker.url}" />
    </bean>


    <bean id="topicConnectionFactoryBean" class="com.atomikos.jms.AtomikosConnectionFactoryBean"
        init-method="init" destroy-method="close">
        <!-- The unique resource name needed for recovery by the Atomikos core. -->
        <property name="uniqueResourceName">
            <value>JMS_BROKER</value>
        </property>
        <property name="xaConnectionFactory">
            <ref bean="xaFactory" />
        </property>
        <property name="minPoolSize" value="10"/>
        <property name="maxPoolSize" value="100"/>
    </bean>
Ranjit Nair Send private email
Friday, June 08, 2012
 
 
I seem to have have the same problem. I am using AtomikosTransactionsEssentials-3.8.0 with ActiveMQ 5.5.1.

This problem appears if I have set the minPoolSize and maxPoolSize to something other than the default of 1. Have you tried using the default pool size of 1?

If I comment out the two PoolSize below, I end up with the default min and max of 1, and this problem does not occur.

  <bean id="atkTopicConnectionFactoryBean" class="com.atomikos.jms.AtomikosConnectionFactoryBean" init-method="init" destroy-method="close">
    <property name="uniqueResourceName" value="ATK_TOPIC_BROKER"/>
    <property name="xaConnectionFactory" ref="jmsXAFactoryWithPW"/>
    <property name="minPoolSize" value="250"/>
    <property name="maxPoolSize" value="400"/>
  </bean>

Log output at initialization is:

 [10 Jul 2012 10:40:28,006] INFO  1887  [pool-2-thread-1.Slf4jLogger.logInfo] com.atomikos.jms.AtomikosConnectionFactoryBean - AtomikosConnectionFactoryBean 'ATK_TOPIC_BROKER': initializing with [ xaConnectionFactory=org.apache.activemq.ActiveMQXAConnectionFactory@fe2254a, xaConnectionFactoryClassName=null, uniqueResourceName=ATK_TOPIC_BROKER, maxPoolSize=400, minPoolSize=250, borrowConnectionTimeout=30, maxIdleTime=60, reapTimeout=0, maintenanceInterval=60, xaProperties=[], localTransactionMode=false]


I can reproduce the problem:
It occurs for me when ActiveMQ dies or is shutdown just before returning across the transaction boundary. i.e. The JMS send and DB update is complete, and then AMQ is stopped  or dies before returning across the transaction boundary. The immediate result (as is correct functionality) is the DB and JMS transactions are not committed. Subsequently though, even after AMQ has been restarted, I will continue to get this failure with all subsequent publication.

This is a serious problem since it will breaks critical functionality – I am no-longer able to publish via JMS.

[10 Jul 2012 11:20:12,370] INFO  2386251 [OperDataPubisher.Slf4jLogger.logInfo] com.atomikos.jms.AtomikosConnectionFactoryBean - AtomikosConnectionFactoryBean 'ATK_TOPIC_BROKER': createConnection()...
[10 Jul 2012 11:20:12,371] INFO  2386252 [OperDataPubisher.Slf4jLogger.logInfo] com.atomikos.jms.AtomikosConnectionFactoryBean - AtomikosConnectionFactoryBean 'ATK_TOPIC_BROKER': init...
[10 Jul 2012 11:20:12,372] WARN  2386253 [OperDataPubisher.Slf4jLogger.logWarning] com.atomikos.datasource.pool.ConnectionPool - atomikos connection pool 'ATK_TOPIC_BROKER': error creating proxy of connection atomikos pooled connection for resource ATK_TOPIC_BROKER
com.atomikos.datasource.pool.CreateConnectionException: atomikos pooled connection for resource ATK_TOPIC_BROKER: connection is erroneous
    at com.atomikos.jms.AtomikosPooledJmsConnection.testUnderlyingConnection(AtomikosPooledJmsConnection.java:71)
    at com.atomikos.datasource.pool.AbstractXPooledConnection.createConnectionProxy(AbstractXPooledConnection.java:70)
    at com.atomikos.datasource.pool.ConnectionPool.borrowConnection(ConnectionPool.java:164)
    at com.atomikos.jms.AtomikosConnectionFactoryBean.createConnection(AtomikosConnectionFactoryBean.java:591)
….
[10 Jul 2012 11:20:12,379] WARN  2386260 [OperDataPubisher.Slf4jLogger.logWarning] com.atomikos.jms.AbstractJmsProxy - Could not create an XASession on the javax.jms.XAConnectionFactory's XAConnection - check if your JMS backend is configured for XA?
org.apache.activemq.ConnectionFailedException: The JMS connection has failed: java.io.EOFException
    at org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1362)
    at org.apache.activemq.ActiveMQXAConnection.createSession(ActiveMQXAConnection.java:70)
    at org.apache.activemq.ActiveMQXAConnection.createXASession(ActiveMQXAConnection.java:58)
nick elliot Send private email
Tuesday, July 10, 2012
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics