Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #5342

Re: LinkLocal Address ( InetAddress.getByName throws UnknownHost Exception )

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!d26g2000prn.googlegroups.com!not-for-mail
From Lewis Bloch <lewisbloch@google.com>
Newsgroups comp.lang.java.programmer
Subject Re: LinkLocal Address ( InetAddress.getByName throws UnknownHost Exception )
Date Fri, 17 Jun 2011 06:27:32 -0700 (PDT)
Organization http://groups.google.com
Lines 40
Message-ID <7ae996e5-64a1-460a-963b-7659dadd90e2@d26g2000prn.googlegroups.com> (permalink)
References <342cbab4-13c5-464c-8b02-18c23de35a39@y30g2000yqb.googlegroups.com>
NNTP-Posting-Host 108.89.33.208
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1308317252 19477 127.0.0.1 (17 Jun 2011 13:27:32 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Fri, 17 Jun 2011 13:27:32 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info d26g2000prn.googlegroups.com; posting-host=108.89.33.208; posting-account=6gJCewoAAAATGk_BiH9Eo-1pkyAWegc7
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-Header-Order ASELCHRU
X-HTTP-UserAgent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91 Safari/534.30,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5342

Show key headers only | View raw


On Jun 14, 11:15 pm, saggar <sunil.sag...@gmail.com> wrote:
> Hi,
>
> I used the following code to create a InetAddress from lilnklocal
> address ( returned by getifaddrs function).
>    try{
>         InetAddress add =
> InetAddress.getByName("fe80::216:3eff:fe38:74e8%eth0");
>      }
>      catch(UnknownHostException uhe){
>         System.out.println("Caught unknownhost exception ");
>         System.out.println("Message: "+uhe.getMessage());
>         uhe.printStackTrace();
>     }
>
> But it fails with the following message.
>
> java.net.UnknownHostException: no scope_id found
>         at java.net.Inet6Address.deriveNumericScope(Inet6Address.java:
> 358)
>         at java.net.Inet6Address.initif(Inet6Address.java:321)
>         at java.net.Inet6Address.initstr(Inet6Address.java:306)
>         at java.net.Inet6Address.<init>(Inet6Address.java:232)
>         at java.net.InetAddress.getAllByName(InetAddress.java:1062)
>         at java.net.InetAddress.getAllByName(InetAddress.java:1009)
>         at java.net.InetAddress.getByName(InetAddress.java:959)
>
> What could be the possible reasons for it ?  Is it specific to JDK
> version ?
>

The error message is quite clear - the DNS does not recognize the host
name.  What you passed to the call really doesn't look like a host
name, so that seems unsurprising.

--
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

LinkLocal Address ( InetAddress.getByName throws UnknownHost Exception ) saggar <sunil.saggar@gmail.com> - 2011-06-14 23:15 -0700
  Re: LinkLocal Address ( InetAddress.getByName throws UnknownHost Exception ) Lewis Bloch <lewisbloch@google.com> - 2011-06-17 06:27 -0700
    Re: LinkLocal Address ( InetAddress.getByName throws UnknownHost Exception ) lewbloch <lewbloch@gmail.com> - 2011-06-17 06:33 -0700

csiph-web