Article View: borland.public.jbuilder.java.api
Article #2998UnknownHostException
From: Paul Waldo
Date: Fri, 19 Jun 1998 00:00
Date: Fri, 19 Jun 1998 00:00
54 lines
2526 bytes
2526 bytes
Hi all,
I have the following code:
InetAddress localHost;
try
{
localHost = InetAddress.getLocalHost ();
}
catch (UnknownHostException e)
{
localHost = InetAddress.getByName ("localhost");
}
InetAddress [] localInterfaces;
localInterfaces = InetAddress.getAllByName (localHost.toString
());
When I run it, I get the following exception:
Stopped at line 182 in file
E:\Projects\reorganized_pvd\waic_pvd\src\DISServer\DISService.java.
Source breakpoint occurred.
Exception breakpoint occurred at line 493 in file [E:\Program
Files\JBuilder2\java\src.zip]\java\net\InetAddress.java. :
java.net.UnknownHostException thrown (unhandled). Do you want to
continue running?
System Error: java.net.UnknownHostException: paul/206.142.16.108
System Error: at java.net.InetAddress.getAllByName0(Compiled Code)
System Error: at java.net.InetAddress.getAllByName(Compiled Code)
System Error: at
DISServer.DISService.processCommandLine(DISService.java:189)
System Error: at DISServer.DISService.main(DISService.java:78)
System Error: at DISServerStarter.main(DISServerStarter.java:9)
Process Exit: E:\Program Files\JBuilder2\bin\bjbDBKJV.EXE
I don't understand why this might happen. The getLocalHost() call
works fine, so I would assume that getAllByName() would work fine too.
I am running NT 4.0. I am connected to the internet via dialup to my
ISP, and my machine name is paul. Pinging paul returns
Pinging paul.sysnet.net [206.142.16.108] with 32 bytes of data:
Reply from 206.142.16.108: bytes=32 time=10ms TTL=128
Reply from 206.142.16.108: bytes=32 time<10ms TTL=128
Reply from 206.142.16.108: bytes=32 time<10ms TTL=128
Reply from 206.142.16.108: bytes=32 time<10ms TTL=128
Everything should be OK, but I get this exception. Any ideas? TIA
Paul
--
To thwart spam, I have made my email address bogus.
Please replace "IHateSpam" in my email address with
"geocities".
Sorry for the inconvenience; blame it on the spammers.
Technical Details
Message-ID:
<6mem6u$ck63@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,54f9e4c7097f94df,start X-Google-Attributes: gid1089d0,public From: "Paul Waldo" <pwaldo@IHateSpam.com> Subject: UnknownHostException Date: 1998/06/19 Message-ID: <6mem6u$ck63@forums.borland.com> X-Deja-AN: 364312344 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.api