3 Replies Latest reply on Aug 29, 2006 3:02 AM by wdfink

    Cannot connect to port 1099

    bkaremba

      Hi

      I am using JBoss 3.2.7 and I have an application that need to connect to the server via port 1099. However I am getting the error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out


      A "netstat -ao" shows me that java.exe is listening on localhost:1099 (and other ports)

      However when I try to "telnet 127.0.0.1 1099" or "localhost 1099" all I get is:

      ¼?sr?java.rmi.MarshalledObject|??ù?c?>??I?hashlocBytest?[BobjBytesq~?xp?O?»ur?[B¼??°T??xp#¼?t?http://Brian:8083/q~q~uq~??¼?sr o
      rg.jnp.server.NamingServer_Stub??xrjava.rmi.server.RemoteStub????ïße?xr?java.rmi.server.RemoteObject?a?æ
      a3??xpw5
      UnicastRef2
      10.2
      U,c?Çx?J?

      Connection to host lost.

      C:\Documents and Settings\Administrator>

      I can telnet into all other ports on the localhost that java.exe is listening on except 1099. Please help.

      Regards

      Brian

        • 1. Re: Cannot connect to port 1099
          wdfink

          This looks OK.
          Your JBoss is up and running and will give a RMI connection.
          But telnet does not understand.

          IMO that is not the problem ;-(

          • 2. Re: Cannot connect to port 1099
            bkaremba

            Hi

            Thanks for the quick response wdfink!

            RE: But telnet does not understand.

            Does this mean that I should not be able to telnet port 1099 on the localhost?

            The following is the method I use in the application to get the initialcontext, what changes need to be made to this code so that I can connect to the naming server:

            public static Context getInitialContext() throws NamingException {
            Hashtable<String,String> props = new Hashtable<String,String>();
            props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
            props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
            props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
            return = new InitialContext(props);
            }

            Regards

            Brian

            • 3. Re: Cannot connect to port 1099
              wdfink

              Hi Brian,
              I meant that the answer from JBoss in your telnet is correct.
              JBoss will give a Remotestub, but telnet dont work with it.

              Your connection should work without the URL_PKG_PREFIXES this only restricts the packages.

              regards
              Wolf