5 Replies Latest reply on Apr 13, 2005 3:57 PM by Benson Fung

    javax.naming.NameNotFoundException

    flower_tang Newbie

      Sorry....maybe this question has already asked before, but i still can't find the answer.

      These are defined by default in JBoss

      queue = "queue/testQueue"
      queue_connection_factory = "ConnectionFactory"

      How can change this? Because I want to lookup "QueueConnectionFactory". When I lookup QueueConnectionFactory, I get the error "javax.naming.NameNotFoundException: QueueConnectionFactory not bound".
      How can solve this?

      here is the code i'm using:

      public static void main(String[] args) {
      try{
      Context jndiContext = new InitialContext();
      QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)context.lookup("QueueConnectionFactory");
      Queue queue = (Queue)context.lookup("queue/testQueue");

      } catch (NamingException nEx){
      System.out.println(nEx.toString() + "\nDoes the queue exist?");
      System.exit(1);
      }
      }

      THX