2 Replies Latest reply on Nov 18, 2002 11:26 AM by felix

    Cannot connect to the server for send message using JMS

    felix Newbie

      I'm making tests with JMS using JBoss-2.4.8

      I cannot connect with the server, that is running in another machine than the client.

      The error tell me than I connect to and I have specified as property Context.PROVIDER_URL the IP of the

      This is the error :

      Queue name is queue/testQueue
      JNDI lookup failed: javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host:; nested exception is:
      java.net.ConnectException: Connection refused: connect]

      And this is the extract of the code:

      Properties env=new Properties();

      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, ""); //
      env.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces" );

      try {

      jndiContext = new InitialContext(env);
      } catch (NamingException e) {
      System.out.println("Could not create JNDI " +
      "context: " + e.toString());

      * Look up connection factory and queue. If either does
      * not exist, exit.
      try {
      queueConnectionFactory = (QueueConnectionFactory)
      queue = (Queue) jndiContext.lookup(queueName);
      } catch (NamingException e) {
      System.out.println("JNDI lookup failed: " +

      Can anybody tell me what it's wrong?

      Thanks in advance