users@glassfish.java.net

Re: Glassfish 2.0 ur2 b04 on Ubuntu - rmi - Connection refused to host

From: <glassfish_at_javadesktop.org>
Date: Mon, 17 Nov 2008 06:00:56 PST

NOTE: From http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html#netmultihomed

RMI will use an IP address or a fully qualified domain name to identify a machine that serves a remote object. Server hostnames are initialized to the value obtained by performing the following actions:

By default, RMI uses the IP address of the server host as the server name for remote references.
If the property java.rmi.server.hostname is set, RMI will use its value as the server hostname, and will not attempt to find a fully qualified domain name through any other method. This property takes precedence over all other means of finding an RMI server name.
If the property java.rmi.server.useLocalHostname is set to true (by default, the value of this property is false), RMI applies the following routine to obtain a hostname for the RMI server:
If the value returned by the InetAddress.getLocalHost().getHostName() method contains a "." character, then RMI will assume that this value is the server's fully qualified domain name and will use it as the server hostname.
Otherwise, RMI will spawn a thread to query the local name service for the fully qualified domain name of the RMI server. If the name service takes too long to return, or the name service returns but its response does not contain a "." then RMI will use the server's IP address obtained from InetAddress.getLocalHost().getHostAddress().
Users can override the default time (10 seconds or 10000 milliseconds) that RMI will look for a fully qualified domain name by setting the following property:
sun.rmi.transport.tcp.localHostnameTimeOut=timeOutMillis
where timeOutMillis is the time that RMI will wait in milliseconds. For example:
            java -Dsun.rmi.transport.tcp.localHostnameTimeOut=2000 MyServerApp
[Message sent by forum member 'not_mel' (not_mel)]

http://forums.java.net/jive/thread.jspa?messageID=317053