Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 11813 invoked from network); 30 Jan 2010 22:47:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Jan 2010 22:47:31 -0000 Received: (qmail 45408 invoked by uid 500); 30 Jan 2010 22:47:30 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 45348 invoked by uid 500); 30 Jan 2010 22:47:30 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 45338 invoked by uid 99); 30 Jan 2010 22:47:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jan 2010 22:47:30 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [92.42.190.144] (HELO ok2cons2.nine.ch) (92.42.190.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jan 2010 22:47:18 +0000 Received: from [192.168.1.105] (77-58-241-174.dclient.hispeed.ch [77.58.241.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id 8169A4BA418 for ; Sat, 30 Jan 2010 23:46:58 +0100 (CET) Subject: RE: org.apache.http.conn.HttpHostConnectException: Connection to http://server.name.com refused From: Oleg Kalnichevski To: HttpClient User Discussion In-Reply-To: <015801caa142$b27647d0$1762d770$@mihailescu@computaris.com> References: <4153169270989238205@unknownmsgid> <19196d861001291433q27b582b9g6b66eb49be55927a@mail.gmail.com> <-5332843506534948818@unknownmsgid> <19196d861001291453q745ab2e2ka6c041f9edea681a@mail.gmail.com> <015801caa142$b27647d0$1762d770$@mihailescu@computaris.com> Content-Type: text/plain; charset="UTF-8" Date: Sat, 30 Jan 2010 23:46:57 +0100 Message-ID: <1264891617.2030.18.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Fri, 2010-01-29 at 16:25 -0800, Razvan Mihailescu-Baltag wrote: > We don't use any special proxy for the java applications and for other > applications. > > Bellow is a request being made to the public url: > > wget http://server.name.com/directory > --00:09:23-- http://server.name.com/directory > => `directory' > Resolving server.name.com... server.ip.address > Connecting to server.name.com:80... connected. > HTTP request sent, awaiting response... 301 Moved Permanently > Location: http://server.ip.address/directory/ [following] > --00:09:23-- http://server.ip.address/directory/ > => `index.html' > Reusing existing connection to server.ip.address:80. > HTTP request sent, awaiting response... 200 OK > Length: 44 [text/html] > index.html: Permission denied > > Next, the request being made to the private url: > > wget http://server.name.com > --00:14:08-- http://server.name.com/ > => `index.html' > Resolving server.name.com... server.ip.address > Connecting to server.name.com |server.ip.address|:80... connected. > HTTP request sent, awaiting response... 403 Forbidden > 00:14:08 ERROR 403: Forbidden. > > My understanding here is that we have basic connectivity to the server. Wget > is able to establish a connection to the server, but it seems that http client > throws an exception at > org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:127). > > Unfortunatelly, on the machine where my java application runs I cannot install > any other applications and only have wget and curl tools. > > The root exception is thrown by the java.net.PlainSocketImpl class. This is a local connectivity problem, which has nothing to do with HttpClient. The target host is either not accessible or the timeout value is too aggressive. > > > > 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) > > > The fact that you can access the target host from _another_ machine is meaningless. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org