0 Replies Latest reply on Jul 5, 2006 1:02 PM by Margaret Lyell

    Problem getting ConnectionFactory JBOSS 4.0.3SP1

    Margaret Lyell Newbie

      I am trying to get JMS running between 2 applications on the same machine. I have written a new Mbean for the new Topic channel -- and it shows up when JBOSS starts up.

      But I am having a problem getting to the ConnectionFActory and to the Topic ConnectionFActory

      My code -- setting the Context Part
      properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
      properties.put(Context.PROVIDER_URL,"jnp://localhost:1099") ;

      And i set up the InitialConcext and lookups as follows:

      InitialContext ctx = new InitialContext(properties);
      System.out.println("Looking up connection factory");
      Object tmp = ctx.lookup("ConnectionFactory");
      TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
      System.out.println("Creating topic connection");

      OUTPUT of the Running CodE:

      Looking up connection factory
      Exception in thread "main" javax.naming.NoInitialContextException: Need to speci
      fy class name in environment or system property, or as an applet parameter, or i
      n an application resource file: java.naming.factory.initial
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247
      at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at Sender.setUpPublishing(Sender.java:54)
      at SenderTest.main(SenderTest.java:53)

      thanks for your help