|
|
|
|
|
Re: JDK is pooched [Was: eclipse cannot resolve domain names] [message #327475 is a reply to message #327471] |
Mon, 21 April 2008 21:17 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: wegener.cboenospam.com
"rektide" <rektide@gmail.com> wrote in message
news:06cada9a28126d134cd44b1eb2275d18$1@www.eclipse.org...
> Error appears to lie in my JDK. Again for reference I am using the
> ia32-java-6-sun package on Debian Testing. I have filed a bug report
> against it at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477211
>
> I used the following program to test whether the JDK can resolve domain
> names:
>
> // code modified from
> // http://www.rgagnon.com/javadetails/java-0452.html
> import java.net.InetAddress;
>
> public class SimpleDNS {
>
> public static void main( String args[] ) {
> if( args.length == 0 ) {
> System.err.println( "Usage: SimpleDNS host" );
> System.exit( 99 );
> }
> for( int i = 0; i < args.length; i++ ) {
> try {
> System.out.println( args[i] + " is " +
> doLookup( args[i] ));
> }
> catch( Exception e ) {
> System.out.println(args[i] + " : " + e.getMessage());
> e.printStackTrace();
> }
> }
> }
>
> static String doLookup( String hostName ) throws Exception {
> InetAddress addr = InetAddress.getByName( hostName );
> return addr.getHostAddress();
> }
> }
>
> Excepted:
> slashdot.org is 66.35.250.150 [ed: or permutation thereof]
>
> Result:
> slashdot.org : slashdot.org
> java.net.UnknownHostException: slashdot.org
> at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
> at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:84 9)
> at
> java.net.InetAddress.getAddressFromNameService(InetAddress.j ava:1200)
> at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
> at java.net.InetAddress.getAllByName(InetAddress.java:1083)
> at java.net.InetAddress.getAllByName(InetAddress.java:1019)
> at java.net.InetAddress.getByName(InetAddress.java:969)
> at SimpleDNS.doLookup(SimpleDNS.java:25)
> at SimpleDNS.main(SimpleDNS.java:14)
>
Have you tried to perform the lookup manually outside of a Java application?
What does "nslookup slashdot.org" give you back?
|
|
|
Powered by
FUDForum. Page generated in 0.04594 seconds