3 Replies Latest reply on Dec 17, 2004 11:59 AM by adrian.brock

    Configuration of JMS on JBoss

    jagdishmane

      Hi,

      We are having the following error when we try to communicate to Jboss 4.0 via JNDI. Here is my code. Can anybody help me out with this ?
      public SimpleSender() {

      try {

      QueueConnectionFactory myQConnFactory;
      Queue myQueue;
      Properties properties = new Properties();
      properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      properties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
      properties.put(Context.PROVIDER_URL,"jnp://localhost:1099");
      Context ctx = new InitialContext(properties);
      myQConnFactory = (QueueConnectionFactory) ctx.lookup("java:/ConnectionFactory");
      myQueue = (Queue) ctx.lookup("queue/testQueue");
      ctx.bind("SimpleSender",myQueue);
      QueueConnection con = myQConnFactory.createQueueConnection();
      QueueSession session = con.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
      TextMessage textMessage = session.createTextMessage();
      QueueSender sender = session.createSender(myQueue);
      con.start();
      for(int i=0;i<10;i++){
      textMessage.setText("Hello World " + i );
      sender.send(textMessage);
      }
      con.close();
      ctx.close();
      } catch(Exception ex) {
      ex.printStackTrace() ;
      }
      }

      Is there anything that I missing out.

      Jagdish

        • 1. Re: Configuration of JMS on JBoss
          jagdishmane

          Hi,

          The error that I am getting is as follows
          javax.naming.NameNotFoundException: ConnectionFactory not bound
          at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
          at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
          at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
          at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:529)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
          at javax.naming.InitialContext.lookup(InitialContext.java:347)
          at SimpleSender.(SimpleSender.java:49)
          at SimpleSender.main(SimpleSender.java:24)

          • 2. Re: Configuration of JMS on JBoss
            starksm64

            Moved to the user forum.

            • 3. Re: Configuration of JMS on JBoss

              Moderated: FAQ
              java: namespace not available over "remote" jndi