5 Replies Latest reply on Apr 23, 2003 7:52 PM by mlivingston

    Extenal Client Lookup

    eslam Newbie

      Hi all
      I have and EJB deployed on JBOSS and I succeed to lookup on it from web client . But when I try to build external client it give me null when I lookup on it. Even I make all the needed steps

      Properties env = new Properties();

      Context initContext = new InitialContext(env);

      where channel is the JNDI of my EJB it give me null can any body help me
      Thanks in advance

        • 2. Re: Extenal Client Lookup
          mlivingston Newbie

          I am having the same problem using RedHat Linux 8.0. Same .ear file deployed on a Win2K box works fine. Here is my information.

          Context jndiContext;

          Properties env = new Properties();
          env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
          env.put("java.naming.provider.url", ":1099");

          jndiContext = new InitialContext(env);

          listContext(jndiContext, "");

          The listContext method sets up NamingEnumeration and Binding objects to list the context data. The following error is thrown while trying to do this.

          javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host:; nested exception is:
          java.net.ConnectException: Connection refused: connect]

          The RedHat installation is very very minimal and I think something is missing and not allowing the remote communication through port 1099. BTW, http traffic on this box works great as does ftp and telnet as these were properly set up. Any help is much appreciated.

          • 3. Re: Extenal Client Lookup
            Raja Master

            For Redhat, add an entry in /etc/hosts that maps to the

            • 4. Re: Extenal Client Lookup
              Adrian Brock Master

              Other way around, remove the mapping
              of to your hostname


              • 5. Re: Extenal Client Lookup
                mlivingston Newbie

                Adding the map in the hosts file did not work.

                However, if I start the JBoss server with -Djava.rmi.server.hostname= parameter everything works fine!

                It seems strange that the remote connection works fine on Windows but requires this parameter when starting JBoss on RedHat Linux. Try this and see if it solves your problem.