tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Armstrong <>
Subject [Fwd: RE: 'localhost' v '' in]
Date Tue, 19 Jun 2001 22:01:17 GMT
This just in from Jay. I think he's probably right that it's 2000 only
-- I had thought I had the problem on NT too, but I can't now remember
the chronology of seeing the problem on a particular machine and
replacing NT with 2000 on the same machine -- it may be that I'd already
upgraded it to 2k when I saw the problem.

-------- Original Message --------
Subject: RE: 'localhost' v '' in
   Date: Tue, 19 Jun 2001 16:48:07 -0500
   From: "Burgess, Jay" <>
     To: "''" <>

I've got problems sending to the newsgroup, but I thought I'd reply
personally, in case it helps.

Are you definitely having problems with both 2000 and NT, or maybe just
2000?  I found a bug with InetAddress.getLocalHost() on WIN2000, and
maybe it's related to the way Tomcat works internally.  The code below
shows it best:

    try {
        localHost = InetAddress.getLocalHost();
        //  Because of a bug on WIN 2000, getLocalHost() may
        //  return, for this machine.  Clear localHost
        //  flag so we can try again below.
        if (localHost.getHostAddress().equals("")) {
            localHost = null;
    catch (UnknownHostException e) {
    //  If we haven't succeeded yet, try the loopback address.
    if (localHost == null) {
        try {
            localHost = InetAddress.getByName("");
        catch (UnknownHostException e2){
            throw (new Exception("Unable to resolve local host name."));



-- Jay Burgess
   Delano Technology Corporation
   (913) 438-9444 x154

-----Original Message-----
From: Andy Armstrong []
Sent: Tuesday, June 19, 2001 4:39 PM
To: Tomcat Dev
Subject: 'localhost' v '' in

Has anyone else found that NT/2000 can't resolve 'localhost' in a line

in conf/

I had the problem when I was developing the domino connector and someone

else has just reported the same problem to me. On the machine where I
had the problem

  nslookup localhost

was fine, and the problem persisted whether or not there was a localhost

entry in hosts. I haven't tried other hostnames there.

Andy Armstrong, Tagish

View raw message