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

    Extenal Client Lookup

    eslam_ma

      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();
      env.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      env.put("java.naming.provider.url","jnp://Eabbass-2p-538:1099");
      env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");

      Context initContext = new InitialContext(env);
      initContext.lookup("Channel");

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

        • 1. Re: Extenal Client Lookup

          RedHat?

          • 2. Re: Extenal Client Lookup
            mlivingston

            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");
            env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");

            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: 127.0.0.1; 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
              raja05

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

              • 4. Re: Extenal Client Lookup

                Other way around, remove the mapping
                of 127.0.0.1 to your hostname

                Regards,
                Adrian

                • 5. Re: Extenal Client Lookup
                  mlivingston

                  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.