Name: diC59631 Date: 08/05/98
1. The error occurrs under the following circumstances:
-nscd is not running
-"files" is the first entry in hosts of /etc/nsswitch.conf
2. program:
import java.net.*;
public class LocalName
{
public static void main(String args[]) throws Exception
{
System.out.println("InetAddress.getLocalHost(): "
+ InetAddress.getLocalHost());
}
}
3. The output is the first host in /etc/hosts (which
may be any host).
The problem seems to appear in any Java Version
including 1.1.5, 1.2Beta4 under Solaris2.5 and
Solaris2.6.
4. Seems to be a simular problem like bug id
4073539, which is marked to be fixed, but
I can reproduce the error on JDK1.2Beta4 (local
host is wspain, first entry in /etc/hosts is
svstch):
(wspain:~/java/gethost) java -version
java version "1.2beta4"
Classic VM (build JDK-1.2beta4-K, green threads, sunwjit)
(wspain:~/java/gethost) java LocalName
InetAddress.getLocalHost(): svstch/137.156.206.3
(Review ID: 36370)
======================================================================
- duplicates
-
JDK-4073539 InetAddress get local host fails on Solaris in some cases
-
- Resolved
-