2 Replies Latest reply on Jun 27, 2006 5:33 AM by chvnkishore

    JNDI Problem when using client to JBoss

    fyness

      Hi,

      I'm to make a connection to a JNDI in JBoss from an client outside JBoss. I'm using the following JNDI.properies file:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jnp.interfaces
      java.naming.provider.url=jnp://localhost:1099

      And i'm getting the following error:

      [java] javax.naming.CommunicationException [Root exception is java.rmi.NoSuchObjectException: no such object in table]
      [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
      [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)

      Any one any ideas what causes this and how to resolve it!
      Thanks,
      Sue

        • 1. Re: JNDI Problem when using client to JBoss
          bhupendra.yaduvenshi

          In clude the jnpclient.jar

          Bhupendra
          bhupendra.yaduvenshi@gmail.com

          • 2. Re: JNDI Problem when using client to JBoss
            chvnkishore

            Try this code it is not giving any err.


            //to work this prog fine set classpath to "jbossall-client.jar;."
            import javax.naming.*;
            import java.util.*;
            public class HelloWorld
            {
            public static void main(String[] args) throws Exception
            {

            Hashtable properties = new Hashtable();

            //Jboss server properties.


            properties.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
            properties.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
            properties.put("java.naming.provider.url", "jnp://localhost:1099");

            //Get the InitialContext.

            Context ic = new InitialContext(properties);

            System.out.println(ic);

            ic.bind("AP","AP");
            ic.bind("AP.Hyd","Hyd");

            System.out.println(ic.lookup("AP"));
            System.out.println(ic.lookup("AP.Hyd"));


            }

            }