5 Replies Latest reply on Apr 3, 2003 12:33 PM by kkennelly

    JNDI lookup returns null for remote clients

    kkennelly Newbie

      Hi,

      I am having trouble with a remote Swing application accessing JBoss. When the client runs on the same machine as the the one JBoss is running on, everything is OK. However I'm receiving a null reference on the JNDI lookup when the client is on a different machine.

      ENVIRONMENT:
      Java: JDK 1.3.1
      OS: Windows 2000
      JBOSS: 3.0

      Hosts file:
      127.0.0.1 localhost
      10.144.1.1 myhost

      code snippet:
      Properties properties = new Properties();
      properties.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      properties.setProperty("java.naming.provider.url","jnp://localhost:1099/");
      properties.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");

      InitialContext = new InitialContext(properties);

      EjbTestHome ejbTestHome = (EjbTestHome)javax.rmi.PortableRemoteObject.narrow(context.lookup("TestEJB"),EjbTestHome.class);

      When I run the application on a remote machine the url is changed to:

      properties.setProperty("java.naming.provider.url","jnp://myhost:1099/");

      Any help with this would be greatly appreciated.

      Keith