3 Replies Latest reply on Mar 19, 2012 10:56 AM by cegparamesh

    HornetQ error - Unable to connect to server using configuration InVMConnectorFactory

    cegparamesh

      Hi All,

       

      I'm facing an error while setting up HornetQ(2.1.2.Final) in JBoss 5.1.

       

      Please let me know what might be wrong in the way I'm connecting.

       

      WARN  [jms.listener.DefaultMessageListenerContainer] (jmsContainer-1) Could not refresh JMS Connection for destination 'HornetQQueue[myQueue]' - retrying in 5000 ms. Cause: Unable to connect to server using configuration org-hornetq-core-remoting-impl-invm-InVMConnectorFactory?server-id=0

      Here is my connection factory definition:

       

       

         <connection-factory name="InVMConnectionFactory">
            <connectors>
               <connector-ref connector-name="in-vm"/>
            </connectors>
            <entries>
               <entry name="java:/ConnectionFactory"/>
               <entry name="java:/XAConnectionFactory"/>
            </entries>
         </connection-factory>
      
         <queue name="myQueue">
               <entry name="/queue/myQueue"/>
         </queue>
      
      

       

      Thanks for your help.

        • 1. Re: HornetQ error - Unable to connect to server using configuration InVMConnectorFactory
          ataylor

          theres not really enough info for us to help you, core config, client app, topology etc etc

          • 2. Re: HornetQ error - Unable to connect to server using configuration InVMConnectorFactory
            cegparamesh

            Thanks Andy. Here are some additional info:

             

            For testing the connectivity, I wrote a sample JSP with the following code:

             

            Hashtable environment  =new Hashtable();
            environment.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
            environment.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
            
            
            Context jndiContext = new InitialContext(environment);
            QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("java:/ConnectionFactory");
            javax.jms.Queue myQueue = (javax.jms.Queue) jndiContext.lookup("queue/myQueue");
            
            

             

             

            Here is my hornetq configuration :

             

            
               <connectors>
                  <connector name="netty">
                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                     <param key="host"  value="${jboss.bind.address:localhost}"/>
                     <param key="port"  value="${hornetq.remoting.netty.port:9505}"/>
                  </connector>
                  
                  <connector name="netty-throughput">
                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                     <param key="host"  value="${jboss.bind.address:localhost}"/>
                     <param key="port"  value="${hornetq.remoting.netty.batch.port:5555}"/>
                     <param key="batch-delay" value="50"/>
                  </connector>
            
            
                  <connector name="in-vm">
                     <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
                     <param key="server-id" value="${hornetq.server-id:0}"/>
                  </connector>
            
            
               </connectors>
            
            
               <acceptors>
                  <acceptor name="netty">
                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                     <param key="host"  value="${jboss.bind.address:localhost}"/>
                     <param key="port"  value="${hornetq.remoting.netty.port:9505}"/>
                  </acceptor>
                  
                  <acceptor name="netty-throughput">
                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                     <param key="host"  value="${jboss.bind.address:localhost}"/>
                     <param key="port"  value="${hornetq.remoting.netty.batch.port:5555}"/>
                     <param key="batch-delay" value="50"/>
                     <param key="direct-deliver" value="false"/>
                  </acceptor>
            
            
                  <acceptor name="in-vm">
                    <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
                    <param key="server-id" value="0"/>
                  </acceptor>
            
            
               </acceptors>
            
            

             

             

            I'm testing this in my local computer, through localhost. There is no clustering.

            • 3. Re: HornetQ error - Unable to connect to server using configuration InVMConnectorFactory
              cegparamesh

              Ok, This seems to be a jar version issue.

               

              My war file contained the same version of HornetQ JAR files (2.1.2 Final), but somehow there was a mismatch between the installed version in JBoss.

               

              So I removed all the hornetq related JAR files from my WAR and redeployed the application. It worked.