In Java 1.4, I am trying to make an connection to a URL, but since I want to configure a timeout, I am using Apache's httpclient instead of the old school URLConnection.openConnection();
So I have the following:
HttpConnection conn = null;
SimpleHttpConnectionManager httpMgr = new SimpleHttpConnectionManager(true);
HostConfiguration hostConf = new HostConfiguration();
hostConf.setHost(new HttpHost("http://www.google.com"));
conn = httpMgr.getConnectionWithTimeout(hostConf, 30);
conn.open();
But seems like everytime I try to open a connection, I would get a java.net.UnknownHostException: http://www.google.com, even to google.com.
Did I do something wrong..?