3 Replies Latest reply on Jun 30, 2004 9:10 PM by pcross616

    Trouble to connect to remote jms queue

    jamesotta2004

      Hi,

      I am using jboss-3.2.2 in a box with queue named A setup .

      From another machine , I created a client to connect the remote queue A.
      The connection is connect successfully, but when I tried to created
      receiver to receive message. I got the following error.


      javax.jms.InvalidDestinationException: The destination QUEUE.A does not exist !
      at org.jboss.mq.server.ClientConsumer.addSubscription(ClientConsumer.java:131)
      at org.jboss.mq.server.JMSDestinationManager.subscribe(JMSDestinationManager.java:606)
      at org.jboss.mq.server.JMSServerInterceptorSupport.subscribe(JMSServerInterceptorSupport.java:297)
      at org.jboss.mq.security.ServerSecurityInterceptor.subscribe(ServerSecurityInterceptor.java:150)
      at org.jboss.mq.server.TracingInterceptor.subscribe(TracingInterceptor.java:816)
      at org.jboss.mq.server.JMSServerInvoker.subscribe(JMSServerInvoker.java:297)
      at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:307)
      at java.lang.Thread.run(Thread.java:536)

      Queue A is looked up successfully when I printed out.
      and when I move the queue to my local server, everything works fine.

      Can anyone help? please!
      This same code work in jboss-3.2.3

      =====================================
      Following is the client code I am using

      Hashtable hm = new Hashtable();
      hm.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      hm.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      hm.put(Context.PROVIDER_URL, "jnp://remoteserver:1099");

      Context iniCtx = new InitialContext(hm);

      Object tmp = iniCtx.lookup("ConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection();
      System.out.println("qcf = " + qcf);
      System.out.println("conn = " + conn);
      queA = (Queue) iniCtx.lookup("queue/A");

      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      conn.start();
      QueueReceiver recv = session.createReceiver(queA);

        • 1. Re: Trouble to connect to remote jms queue
          nusa

          Check the testsuites.
          There are a lot of simple JMS code in there.

          Suggestions :
          Use the JBoss logger function, instead of the crap System.out.println(...)
          such as :

          <class declaration> {
           private static Logger log = Logger.getLogger(this.class);
          
           <methode> {
           log.debug("Your blah blah blah ...");
           }
          }
          
          


          Again check the testsuites about how to use the logger.

          nusa.


          • 2. Re: Trouble to connect to remote jms queue
            jamesotta2004

            Thanks for the pointer.

            Looking at the test suite code come with the jboss-3.2.2 source, most of the test is looking up ConnectionFactory through localhost rather than through remote server. They didn't help in my case.
            Further look at the code of org.jboss.mq.server.JMSDestinationManager
            seems like that even client code lookup connection and queue successfully, when create QueueReciever, the JMSDestinationManager is looking for the local queue instead of remote queue from "destinations" map.


            • 3. Re: Trouble to connect to remote jms queue

              I am seeing this too. I stepped through the the JMSDestinationManager and it is the wrong one, it is for the local server. Is there anyway to get a remote JBOSS instance to talk to another JBOSS instance running the JMS Topics/Queues? Theres gotta be.. I am just missing it..

              BTW: I tried providing ./run.sh --host= on both server since I saw a post about it not knowing how to bind the JNDI but that seemed not to make a difference.

              any help would be great.

              -Pete