hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Razvan Mihailescu-Baltag" <razvan.mihaile...@computaris.com>
Subject org.apache.http.conn.HttpHostConnectException: Connection to http://server.name.com refused
Date Fri, 29 Jan 2010 22:01:46 GMT
Hi,

 

I’m using in my java application http client 4.0 jar, http core 4.0.1 jar and the application
is running under Solaris environment.

My application sends requests to an http server url (standard Apache 2.2 server). The url
looks like http://server.name.com/directory and this directory has read access rights (can
be easily accessed using a browser, using curl –ivk http://server.name.com/directory or
wget http://server.name.com/directory commands). The root directory http://server.name.com
has forbidden access (the server responds with Forbidden message).

 

When looking in the http client logs, I can see that the http client tries to connect to the
route HttpRoute[HttpRoute[/client.ip->{}->http://server.name.com]. Here are the logs:

 

2010-01-29 18:40:54,808 DEBUG - ConnPoolByRoute - getEntryBlocking - Available capacity: 2
out of 2 [HttpRoute[/client.ip->{}->http://server.name.com]][null]

2010-01-29 18:40:54,808 DEBUG - ConnPoolByRoute - createEntry - Creating new connection [HttpRoute[HttpRoute[/client.ip->{}->http://server.name.com]]

2010-01-29 18:44:03,819 DEBUG - DefaultClientConnection - shutdown - Connection shut down

2010-01-29 18:44:03,819 DEBUG - ThreadSafeClientConnManager - releaseConnection - Released
connection is not reusable.

2010-01-29 18:44:03,819 DEBUG - ConnPoolByRoute - freeEntry - Releasing connection [HttpRoute[/client.ip->{}->http://server.name.com]][null]

2010-01-29 18:44:03,819 DEBUG - ConnPoolByRoute - notifyWaitingThread - Notifying thread waiting
on any pool

2010-01-29 18:44:03,819 DEBUG - HttpClientWrapper - executeHttpPost - The following exception
occured:

org.apache.http.conn.HttpHostConnectException: Connection to http://server.name.com refused

        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:127)

        at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147)

        at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:101)

        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:381)

        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)

        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576)

        at com.nsn.nap.ppc.http.HttpClientWrapper.executeHttpPost(HttpClientWrapper.java:279)

        at com.nsn.nap.ppc.http.HttpClientWrapper.executeHttpPost(HttpClientWrapper.java:343)

        at com.nsn.nap.ppc.partnerThreads.WorkerThread.call(WorkerThread.java:64)

        at com.nsn.nap.ppc.partnerThreads.WorkerThread.call(WorkerThread.java:1)

        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

        at java.util.concurrent.FutureTask.run(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

        at java.lang.Thread.run(Unknown Source)

Caused by: java.net.ConnectException: Connection timed out

        at java.net.PlainSocketImpl.socketConnect(Native Method)

        at java.net.PlainSocketImpl.doConnect(Unknown Source)

        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)

        at java.net.PlainSocketImpl.connect(Unknown Source)

        at java.net.SocksSocketImpl.connect(Unknown Source)

        at java.net.Socket.connect(Unknown Source)

        at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:123)

        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:123)

        ... 14 more

 

My issue is that I don’t have control over the server’s root directory - http://server.name.com.
What could be done to be able to communicate to the server public url - http://server.name.com/directory?

 

Any help is really appreciated!

 

Razvan


Mime
View raw message