I'm running curl and wget from the same machine the application is running; the web browser is on another one. It's true, with wget I can see the Forbidden response when trying to access the root of the server (http://server.name.com), but that is because of the configuration on the server. The public url (http://server.name.com/directory) has a different uri and I can easily access that uri using wget, curl or a browser. It is possible to instruct http client to connect directly to the public url? Or there is an workaround this issue?
Thank you, Razvan -----Original Message----- From: Sam Berlin [mailto:[email protected]] The issue appears more related to opening a TCP socket to the host, long before the GET request for a specific URL is sent. The java.net.ConnectException is telling you that you can't even open a socket. Are you running curl, wget or the browser from the same machine that your application is running? If not, try doing that -- those applications should exhibit the same error. Sam On Fri, Jan 29, 2010 at 5:01 PM, Razvan Mihailescu-Baltag <[email protected]> wrote: > 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(D efaultClientConnectionOperator.java:127) > > at > org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:14 7) > > at > org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledCon nAdapter.java:101) > > at > org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestD irector.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.j ava:279) > > at > com.nsn.nap.ppc.http.HttpClientWrapper.executeHttpPost(HttpClientWrapper.j ava: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(PlainSocketFa ctory.java:123) > > at > org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(D efaultClientConnectionOperator.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 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] This email is subject to Computaris email terms of use: http://www.computaris.com/email_terms.php
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
