1 Reply Latest reply on Nov 4, 2011 12:24 AM by jaikiran

    Upgrade JB6.0.0->6.1.0, now JMS ConnectionFactory not bound?

    tharris

      Our application has been running fine on JBoss 6.0.0-Final for quite a while now. It uses HornetQ via JMS, and it uses Spring 3.0.6 to configure the queue listeners and senders.

       

      When we upgraded to JBoss 6.1.0-Final, we are now getting a deployment failure:

       

      13:09:44,669 ERROR [STDERR] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsConnectionFactory': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: ConnectionFactory not bound

      13:09:44,669 ERROR [STDERR]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)

      ... lots of irrelevant stack frames ...

      13:09:44,779 ERROR [STDERR] Caused by: javax.naming.NameNotFoundException: ConnectionFactory not bound

      13:09:44,779 ERROR [STDERR]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

      ... more irrelevant stack frames ...

       

      Did something change between 6.0.0 and 6.1.0 that is making the JNDI binding fail? I tried dropping our war files into deploy after the server was fully running, same failure. I looked in the admin-console to find the JMS connection factory and its JNDI bindings, and it shows "java:/ConnectionFactory,java:/XAConnectionFactory". I have also tried setting the "xa" element in the ConnectionFactory to false, still fails. So, I'm not sure what the issue is... Does anyone have some ideas?

       

      Contents of hornetq-jms.xml:

       

      <configuration xmlns="urn:hornetq"

                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                  xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

         <connection-factory name="InVMConnectionFactory">

            <xa>true</xa>

              <connectors>

                  <connector-ref connector-name="in-vm" />

              </connectors>

              <entries>

                  <entry name="java:/ConnectionFactory" />

                  <entry name="java:/XAConnectionFactory" />

              </entries>

          </connection-factory>

         <queue name="DLQ">

            <entry name="/queue/DLQ"/>

         </queue>

         <queue name="ExpiryQueue">

            <entry name="/queue/ExpiryQueue"/>

         </queue>

          <queue name="applicationSpecificQueue">

              <entry name="java:/queue/applicationSpecificQueue"/>

          </queue>

      </configuration>

       

      Spring bean configuration file:

      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"

          xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang"

          xmlns:jms="http://www.springframework.org/schema/jms" xmlns:tx="http://www.springframework.org/schema/tx"

          xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"

          xsi:schemaLocation="

      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd

      http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd

      http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd

      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd

      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"

          default-autowire="byName">

          <jee:jndi-lookup id="jmsConnectionFactory" jndi-name="java:/ConnectionFactory"

              expected-type="javax.jms.ConnectionFactory" lookup-on-startup="true" />

          <bean id="jndiDestinationResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver" />

          <bean id="applicationSpecificQueueListener" class="com.company.ApplicationSpecificQueueListener" />

          <jms:listener-container container-type="default" destination-type="queue"

              destination-resolver="jndiDestinationResolver" connection-factory="jmsConnectionFactory"

              acknowledge="auto" concurrency="1">

              <jms:listener destination="java:/queue/applicationSpecificQueue" ref="applicationSpecificQueueListener" method="onMessage" />

          </jms:listener-container>

      </beans>