activemq-spring Caught exception trying close() when putting session back into the pool, will invalidate. javax.jms.IllegalStateException: The Session is closed

Solution Unverified - Updated -

Issue

We are seeing this warning, "Session closed exception" when using a PooledConnectionFactory.

        <bean id="pooledConnectionFactory" 
           class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop">
           <property name="maxConnections" value="5" />
           <property name="connectionFactory" ref="jmsConnectionFactory" />
        </bean>

and the warning message:

2013-05-21 12:13:23,891 | WARN  | c.businessevent] | PooledSession                    | 130 - org.apache.activemq.activemq-spring - 5.5.1.fuse-7-061 | Caught exception trying close() when putting session back into the pool, will invalidate. javax.jms.IllegalStateException: The Session is closed
javax.jms.IllegalStateException: The Session is closed
        at org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:722)[227:org.apache.activemq.activemq-core:5.5.1.fuse-7-061]
        at org.apache.activemq.ActiveMQSession.setMessageListener(ActiveMQSession.java:804)[227:org.apache.activemq.activemq-core:5.5.1.fuse-7-061]
        at org.apache.activemq.pool.PooledSession.close(PooledSession.java:96)[130:org.apache.activemq.activemq-spring:5.5.1.fuse-7-061]
        at org.springframework.jms.support.JmsUtils.closeSession(JmsUtils.java:108)[143:org.springframework.jms:3.0.7.RELEASE]
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1099)[143:org.springframework.jms:3.0.7.RELEASE]
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)[143:org.springframework.jms:3.0.7.RELEASE]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_13]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_13]
        at java.lang.Thread.run(Thread.java:619)[:1.6.0_13]

Environment

Fuse ESB Enterprise (FuseESB) 7.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content