You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Arash Nikkar <an...@gmail.com> on 2008/03/04 23:56:14 UTC

[HttpClient] No Route to host when using IP Addr for hostname on linux

I haven't been able to figure this out, but when I run my application on
linux and I use an ip addr as the hostname on a linux box (I have tried 4
different ones). I get the following error:

4-Mar-08 7:58:19 AM
org.apache.commons.httpclient.HttpMethodDirectorexecuteWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing
request: No route to host
4-Mar-08 7:58:19 AM
org.apache.commons.httpclient.HttpMethodDirectorexecuteWithRetry
INFO: Retrying request


but the request never gets through, but if i change the ip address to a
hostname, everything works fine (Note: I don't get this problem on windows).

I was wondering if anyone had any ideas as to why this is occuring. Here is
a short excerpt of how I am executing my get method:

GetMethod getMethod = new GetMethod();
        getMethod.getParams().setParameter("USE_EXPECT_CONTINUE", new
Boolean(true)); //this is a result of connection reset on linux machines
        getMethod.getParams().setCookiePolicy(CookiePolicy.RFC_2109);
                    getMethod.setURI(new URI("http://x.xx.xx.xx/test.html,
false));
                    statusCode = client.executeMethod(getMethod);

the code sits on the executeMethod call.

Any ideas?

--arash

Re: [HttpClient] No Route to host when using IP Addr for hostname on linux

Posted by Roland Weber <os...@dubioso.net>.
Arash Nikkar wrote:
> org.apache.commons.httpclient.HttpMethodDirectorexecuteWithRetry
> INFO: I/O exception (java.net.ConnectException) caught when processing
> request: No route to host
> 
> but the request never gets through, but if i change the ip address to a
> hostname, everything works fine (Note: I don't get this problem on windows).

I suspect a misconfigured DNS on your linux box.

Have you tried to resolve the literal IP address in
a small standalone C program, or using some browser
on the Linux box to access the URL?

cheers,
   Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org