Name: sgC58550 Date: 06/23/97
java.net.InetAddress.getLocalHost() returns 127.0.0.1
Platform: Solaris 2.4 on a Sparc station
When I run the following code:
java.net.InetAddress oLocalHost = java.net.InetAddress.getLocalHost();
System.out.println("ReportTestServer.bindServers() - local host name: ");
System.out.println(oLocalHost.getHostName());
System.out.println("ReportTestServer.bindServers() - local host address: ");
System.out.println(oLocalHost.getHostAddress());
I get the following output on the Solaris box:
ReportTestServer.bindServers() - local host name:
localhost
ReportTestServer.bindServers() - local host address:
127.0.0.1
When I run on a WIN95 box, I get the correct local host, e.g.,:
ReportTestServer.bindServers() - local host name:
spider
ReportTestServer.bindServers() - local host address:
129.9.200.103
/etc/hosts is set up as usual with localhost set to 127.0.0.1
and the particluar node set up properly. Both hostname and uname -n
return the proper name/address for the node.
I do belive this is also the cause of the problems with bind/rebind/unbind
in RMI (as documented in other bugs). It also causes Visigenic's
CORBA implementation the same problems. In general this is preventing
me from running servers on a Solaris box and clients on other
boxes using RMI and/or CORBA.
company - Marinbridge Corporation Ltd. , email - ###@###.###
======================================================================
- duplicates
-
JDK-4073539 InetAddress get local host fails on Solaris in some cases
-
- Resolved
-