springspring-bootatomikos

Using spring-boot-starter-jta-atomikos throw error while trying to recycle exception


i am use spring-boot(version is 1.4.1.RELEASE), spring-boot-starter-jta-atomikos and activemq all set by autoconfig, i also add connection pool properties like

# The maximum size of the pool.
spring.jta.atomikos.connectionfactory.max-pool-size=15
# The minimum size of the pool
spring.jta.atomikos.connectionfactory.min-pool-size=10

but when add connection pool properties it will throw exception like

2016-11-08 05:30:07 [WARN] Slf4jLogger- atomikos connection pool 'jmsConnectionFactory': error while trying to recycle java.util.NoSuchElementException
    at java.util.ArrayList$Itr.next(ArrayList.java:834)
    at com.atomikos.jms.AtomikosJmsConnectionProxy.isInactiveInTransaction(AtomikosJmsConnectionProxy.java:383)
    at com.atomikos.jms.AtomikosPooledJmsConnection.canBeRecycledForCallingThread(AtomikosPooledJmsConnection.java:165)
    at com.atomikos.datasource.pool.ConnectionPool.recycleConnectionIfPossible(ConnectionPool.java:127)
    at com.atomikos.datasource.pool.ConnectionPool.findExistingOpenConnectionForCallingThread(ConnectionPool.java:184)
    at com.atomikos.datasource.pool.ConnectionPool.borrowConnection(ConnectionPool.java:149)
    at com.atomikos.jms.AtomikosConnectionFactoryBean.createConnection(AtomikosConnectionFactoryBean.java:616)
    at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.access$100(AbstractPollingMessageListenerContainer.java:75)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer$MessageListenerContainerResourceFactory.createConnection    (AbstractPollingMessageListenerContainer.java:484)
    at org.springframework.jms.connection.ConnectionFactoryUtils.doGetTransactionalSession(ConnectionFactoryUtils.java:312)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:280)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:235)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1166)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1158)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1055)
    at java.lang.Thread.run(Thread.java:745)

how to fix this problem ? thank


Solution

  • after update atomikos version from 3.9.3 to 4.0.4 this warn is disappear

            <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jta-atomikos</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atomikos</groupId>
                    <artifactId>transactions-jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atomikos</groupId>
                    <artifactId>transactions-jta</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.atomikos</groupId>
                    <artifactId>transactions-jdbc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atomikos</groupId>
            <artifactId>transactions-jms</artifactId>
            <version>4.0.4</version>
        </dependency>
        <dependency>
            <groupId>com.atomikos</groupId>
            <artifactId>transactions-jta</artifactId>
            <version>4.0.4</version>
        </dependency>
        <dependency>
            <groupId>com.atomikos</groupId>
            <artifactId>transactions-jdbc</artifactId>
            <version>4.0.4</version>
        </dependency>