4 Replies Latest reply on Feb 27, 2002 7:03 PM by laz777

    *VERY* strange EJB client problem !!!

    cezz

      Hi ! I have an application which uses an EJB. Now, the strange situation is : when I connect to EJB from a remote computer on my LAN everything goes well. BUT when I connect to EJB (on a server in internet) from client I got the message :

      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]

      What's happening ? The server is running on port 1099 (I tested with a simple telnet). Why when connects from remote computers in a local network everything goes well, but when connects from a remote computer over the internet ,i got that message ?

      Please, is a very urgent thing. Can you help me ?

      Best,
      Cezar

        • 1. Re: *VERY* strange EJB client problem !!!
          guy_rouillier

          That message indicates that you are trying to connect to your local system, NOT to a computer over the internet. 127.0.0.1 is localhost. Check jndi.properties.

          • 2. Re: *VERY* strange EJB client problem !!!
            cezz

            I know that, but I set the context in the client application like that :
            Properties props = new Properties();
            props.put(Context.INITIAL_CONTEXT_FACTORY,
            "org.jnp.interfaces.NamingContextFactory");
            props.put(Context.PROVIDER_URL, "212.387.2.2:1099");

            Context ctx = new InitialContext(props);
            FirstHome home = (FirstHome)ctx.lookup("ejb/First");

            So you see i'm not tryin' to connect to my localhost.
            Please can you help ? thx

            • 3. Re: *VERY* strange EJB client problem !!!
              cezz

              I solved this problem !

              i modified jboss.properties and i set the property :
              java.rmi.server.hostname=ip-of-the-server

              and now works perfectly

              • 4. Re: *VERY* strange EJB client problem !!!
                laz777

                Thanks for posting the solution when you found it. :)

                It's really annoying to be searching the forums for a solution, but only finding the question with a "oh, I fixed it" message.

                If everyone did this there would be much less repeated posting of questions.

                -Todd