-
Bug
-
Resolution: Fixed
-
P4
-
7, 8u45, 9
-
b62
-
x86
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084804 | emb-9 | Michael McMahon | P4 | Resolved | Fixed | team |
JDK-8086893 | 8u65 | Robert Mckenna | P4 | Resolved | Fixed | b01 |
JDK-8078702 | 8u60 | Robert Mckenna | P4 | Resolved | Fixed | b14 |
JDK-8138091 | emb-8u65 | Unassigned | P4 | Resolved | Fixed | b01 |
JDK-8079997 | emb-8u60 | Robert Mckenna | P4 | Resolved | Fixed | team |
JDK-8235781 | 7u261 | Ivan Gerasimov | P4 | Resolved | Fixed | b01 |
openjdk version "1.7.0-alpha"
OpenJDK Runtime Environment (build 1.7.0-alpha-106)
OpenJDK 64-Bit Server VM (build 19.0-b05, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Various Linux systems e.g. Ubuntu 10.04 or Gentoo Linux
EXTRA RELEVANT SYSTEM CONFIGURATION :
A nameserver which is accessible via IPv6 is required to reproduce this bug.
A DESCRIPTION OF THE PROBLEM :
Linux systems don't require and moreover don't allow to use IPv6 literal host names within delimiting brackets for nameservers in /etc/resolv.conf. So IPv6 entries have the form:
nameserver 2001:0db8:85a3:08d3:1319:8a2e:0370:7344
When trying to use a nameserver via IPv6 a NumberFormatException is thrown.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Setup a Linux system with IPv6 and a nameserver via IPv6.
2. Compile the provided NSLookup Class
3. Run the application e.g. via java NSLookup A openjdk.org
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected output: openjdk.org: 192.9.170.173
ACTUAL -
A NumberFormatException is thrown.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.NumberFormatException: For input string: "0db8:85a3:08d3:1319:8a2e:0370:7344"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:481)
at java.lang.Integer.parseInt(Integer.java:514)
at com.sun.jndi.dns.DnsClient.<init>(DnsClient.java:122)
at com.sun.jndi.dns.Resolver.<init>(Resolver.java:61)
at com.sun.jndi.dns.DnsContext.getResolver(DnsContext.java:570)
at com.sun.jndi.dns.DnsContext.c_getAttributes(DnsContext.java:430)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(ComponentDirContext.java:231)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:139)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:127)
at javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:140)
at NSLookup.main(NSLookup.java:14)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.naming.directory.*;
import java.util.Hashtable;
public class NSLookup {
public static void main(String[] args) {
if (args.length != 2) {
System.out.println("We need 2 arguments: <TYPE> <DOMAIN>");
return;
}
try {
Hashtable<String,String> env = new Hashtable<String,String>();
env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
DirContext context = new InitialDirContext(env);
Attributes dnsLookup = context.getAttributes(args[1], new String[]{args[0]});
Attribute records = dnsLookup.get(args[0]);
if (records == null) {
System.out.println("No " + args[0] + " record found for domain: " + args[1]);
return;
}
for (int i = 0; i < records.size(); i++) {
System.out.println(args[1] + ": " + records.get(i));
}
context.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
See the discussion of net-dev mailing list:
http://mail.openjdk.java.net/pipermail/net-dev/2010-October/002258.html
- backported by
-
JDK-8078702 IPv6 Nameservers in resolv.conf throws NumberFormatException
-
- Resolved
-
-
JDK-8079997 IPv6 Nameservers in resolv.conf throws NumberFormatException
-
- Resolved
-
-
JDK-8084804 IPv6 Nameservers in resolv.conf throws NumberFormatException
-
- Resolved
-
-
JDK-8086893 IPv6 Nameservers in resolv.conf throws NumberFormatException
-
- Resolved
-
-
JDK-8138091 IPv6 Nameservers in resolv.conf throws NumberFormatException
-
- Resolved
-
-
JDK-8235781 IPv6 Nameservers in resolv.conf throws NumberFormatException
-
- Resolved
-
- relates to
-
JDK-8322243 Parsing of resolv.conf fails for IPv6 in mixed hexidecimal and dot decimial
-
- Open
-
-
JDK-8078276 add copyright header to IPv6NameserverPlatformParsingTest
-
- Resolved
-