Can't create outgoing socket: UnknownHostException

Pering, Trevor trevor.pering@intel.com
Mon Jun 2 18:04:00 GMT 2003


I'm working with an arm-linux-gcj cross-compiler, and I get an error
where the compiled program can not create an outgoing connection -- it
always gets an UnknownHostException. I've distilled it down to the
following test program:
import java.net.*;
public class test {
 public static void main(String argv[])
 {
 try {
 new Socket("localhost",80);
 System.out.println("Success");
 } catch (Exception e) {
 e.printStackTrace();
 }
 }
}
I'm using arm-linux-gcj version 3.3, compiling to test.bin (also using
javac to test.class). Which will either succeed or fail depending on how
I run it:
sh-2.03# java test
Success
sh-2.03# ./test.bin
java.net.UnknownHostException: localhost
 <<No stacktrace available>>
Any idea what's going on here? I tried searching the mailing list, but
was unable to find anything that talked about this... (but there was a
lot of noise so I might have missed something).
Thanks,
	Trevor


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /