S
saggar
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 ?
-Sunil
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 ?
-Sunil