0 Replies Latest reply on Sep 28, 2011 4:12 PM by hbhinder

    JMS consumer not connecting after upgrade to JBoss 5.1.0

    hbhinder

      We have the following set up in the production envrionment:

       

      - our application is running on 3 clustered Jboss instances with spring framework. Each machine has a JMS queue where messages are sent.

      - we have a listener on a separate machine that listens to all 3 queues for messages. If we configure the listener to use ClusteredXAConnectionFactory (which was working as expected in JBoss 4.2.3 with JBoss Messaging), we get the following error at startup.

       

      2011-09-27 13:30:29,200 INFO  [org.springframework.jms.listener.DefaultMessageListenerContainer] (ListGeneratorContainer-5) Setup of JMS message listener invoker failed for destination 'JBossQueue[ListGeneratorQueue]' - trying to recover. Cause: This invocation should not be handled here!

      1. java.lang.IllegalStateException: This invocation should not be handled here!

              at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientClusteredConnectionFactoryDelegate$createConnectionDelegate$aop(ClientClusteredConnectionFactoryDelegate.java:260)

              at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.createConnectionDelegate(ClientClusteredConnectionFactoryDelegate.java)

              at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)

              at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)

              at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)

              at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)

       

      The connection configuration is as follows:

       

       

      <!--JNDI Environment Template for JMS-->

          <bean id="jndiTemplateExternal" class="org.springframework.jndi.JndiTemplate" lazy-init="true">

          <property name="environment">

              <props>

                  <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>

                  <prop key="java.naming.provider.url">IP1:1100,IP2:1100,IP3:1100</prop>

                  <prop key="java.naming.factory.url.pkgs">org.jboss.naming:org.jnp.interfaces</prop>

              </props>

          </property>

          </bean>

       

          <bean id="jmsConnectionFactoryExternal" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">

          <property name="jndiTemplate" ref="jndiTemplateExternal"/>

              <property name="jndiName" value="ClusteredXAConnectionFactory"/>

          </bean>

       

      If we replace jndiName with XAConnectionFactory, the application starts up but the listener doesn't process any messages and they remain unconsumed in the queues until JBoss is restarted. On restarting JBoss, all the existing messages get processed but any new messages still remain stuck.