Announcement Announcement Module
Collapse
No announcement yet.
DefaultMessageListenerContainer and concurrentConsumers > 1 (javax.jms.JMSException) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DefaultMessageListenerContainer and concurrentConsumers > 1 (javax.jms.JMSException)

    I have a DefaultMessageListenerContainer listening to a queue, and concurrentConsumers is set to 1. This works fine, but when I increase concurrentConsumers (e.g. to 3) the following exception appears repeatedly in the console:

    Code:
    14:31:38,165 ERROR org.springframework.jms.listener.DefaultMessageListenerContainer[listenerContainer-57]: Setup of JMS message listener invoker failed - trying to recover
    javax.jms.JMSException: Connection[Oc4jJMS.Connection.PC96MYPC-T60.2fcf83d:116008c6ce2:-8000.119]: cannot create new session inside J2EE container when Session[Oc4jJMS.Session.PC96MYPC-T60.2fcf83d:116008c6ce2:-8000.120,false,AUTO_ACKNOWLEDGE] is currently active.
            at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1034)
            at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1114)
            at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1085)
            at com.evermind.server.jms.EvermindConnection.assertSession(EvermindConnection.java:493)
            at com.evermind.server.jms.EvermindConnection.createSession(EvermindConnection.java:204)
            at org.springframework.jms.listener.AbstractMessageListenerContainer.createSession(AbstractMessageListenerContainer.java:1002)
            at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:915)
            at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:903)
            at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:857)
            at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:203)
            at java.lang.Thread.run(Thread.java:595)
    Anyone who have seen this before? Have to mention that I'm quite new to JMS.. It seems like at least one consumer is instantiated, cause all the messages I send are consumed.

    Btw, I'm using OC4J 10.1.3 and Spring 2.0.7, and my bean definition for the listenerContainer looks like this:
    Code:
    <bean id="listenerContainer"
          class="org.springframework.jms.listener.DefaultMessageListenerContainer">
       <property name="concurrentConsumers" value="3"/>
       <property name="connectionFactory" ref="jmsConnectionFactory" />
       <property name="destination" ref="myQueue" />
       <property name="messageListener" ref="myMessageListener" />
    </bean>
Working...
X