Hello everyone,
I'm getting a connection timed out exception when trying to connect to
my webserver from outside my work network.
I presume it's due to my customer's strange firewall.
I'm setting the proxy this code...
client.getHostConfiguration().setProxy("137.0.0.1",
Integer.parseInt(3128));
I'm stuck on what is causing the problem.
Any help would be great.
Thanks
Jeff Porter
Please excuse the long stack trace below.
2006/10/10 15:41:03:937 BST [DEBUG] HttpClient - -Java version: 1.5.0_06
2006/10/10 15:41:03:937 BST [DEBUG] HttpClient - -Java vendor: Sun
MicrosystemsInc.
2006/10/10 15:41:03:937 BST [DEBUG] HttpClient - -Java class path:
fact_client.jar
2006/10/10 15:41:03:937 BST [DEBUG] HttpClient - -Operating system name:
Windows XP
2006/10/10 15:41:03:968 BST [DEBUG] HttpClient - -Operating system
architecture: x86
2006/10/10 15:41:03:968 BST [DEBUG] HttpClient - -Operating system
version: 5.1
2006/10/10 15:41:04:296 BST [DEBUG] HttpClient - -SUN 1.5: SUN (DSA
key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom;
X.509 certificates;
JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP,
Collection CertStores)
2006/10/10 15:41:04:296 BST [DEBUG] HttpClient - -SunRsaSign 1.5: Sun
RSA signature provider
2006/10/10 15:41:04:296 BST [DEBUG] HttpClient - -SunJSSE 1.5: Sun JSSE
provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
2006/10/10 15:41:04:296 BST [DEBUG] HttpClient - -SunJCE 1.5: SunJCE
Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2,
PBE, Diffie-Hellman
, HMAC)
2006/10/10 15:41:04:515 BST [DEBUG] HttpClient - -SunJGSS 1.0: Sun
(Kerberos v5)
2006/10/10 15:41:04:515 BST [DEBUG] HttpClient - -SunSASL 1.5: Sun SASL
provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL,
PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5)
2006/10/10 15:41:04:515 BST [DEBUG] DefaultHttpParams - -Set parameter
http.useragent = Jakarta Commons-HttpClient/3.0.1
2006/10/10 15:41:04:562 BST [DEBUG] DefaultHttpParams - -Set parameter
http.protocol.version = HTTP/1.1
2006/10/10 15:41:04:562 BST [DEBUG] DefaultHttpParams - -Set parameter
http.connection-manager.class = class
org.apache.commons.httpclient.SimpleHttpConnectionManager
2006/10/10 15:41:04:625 BST [DEBUG] DefaultHttpParams - -Set parameter
http.protocol.cookie-policy = rfc2109
2006/10/10 15:41:04:625 BST [DEBUG] DefaultHttpParams - -Set parameter
http.protocol.element-charset = US-ASCII
2006/10/10 15:41:04:625 BST [DEBUG] DefaultHttpParams - -Set parameter
http.protocol.content-charset = ISO-8859-1
2006/10/10 15:41:04:656 BST [DEBUG] DefaultHttpParams - -Set parameter
http.method.retry-handler =
[EMAIL PROTECTED]
Using PROXY settings:c:\tools\fact\proxy.dat
host:193.115.72.193
port:3128
2006/10/10 15:41:04:781 BST [TRACE] GetMethod - -enter GetMethod(String)
2006/10/10 15:41:04:781 BST [TRACE] HttpClient - -enter
HttpClient.executeMethod(HttpMethod)
2006/10/10 15:41:04:781 BST [TRACE] HttpClient - -enter
HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)
2006/10/10 15:41:04:828 BST [TRACE] HttpMethodDirector - -Attempt number
1 to process request
2006/10/10 15:41:04:828 BST [TRACE] HttpConnection - -enter
HttpConnection.open()
2006/10/10 15:41:04:859 BST [DEBUG] HttpConnection - -Open connection to
193.115.72.193:3128
2006/10/10 15:41:04:890 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.execute(HttpState, HttpConnection)
2006/10/10 15:41:04:890 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.writeRequest(HttpState, HttpConnection)
2006/10/10 15:41:04:890 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.writeRequestLine(HttpState, HttpConnection)
2006/10/10 15:41:04:890 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.generateRequestLine(HttpConnection, String, String,
String, String)
2006/10/10 15:41:04:890 BST [DEBUG] header - ->> "GET
http://137.205.XX.XX/jsp/main.jsf?validateSubject=true HTTP/1.1[\r][\n]"
2006/10/10 15:41:04:890 BST [TRACE] HttpConnection - -enter
HttpConnection.print(String)
2006/10/10 15:41:04:890 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[])
2006/10/10 15:41:04:890 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[], int, int)
2006/10/10 15:41:04:890 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
2006/10/10 15:41:04:921 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)
2006/10/10 15:41:04:921 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection)
2006/10/10 15:41:04:921 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)
2006/10/10 15:41:04:953 BST [DEBUG] HttpMethodBase - -Adding Host
request header
2006/10/10 15:41:04:953 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)
2006/10/10 15:41:04:968 BST [TRACE] HttpState - -enter
HttpState.getCookies()
2006/10/10 15:41:04:968 BST [TRACE] CookieSpec - -enter
CookieSpecBase.match(String, int, String, boolean, Cookie[])
2006/10/10 15:41:04:968 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.addProxyConnectionHeader(HttpState, HttpConnection)
2006/10/10 15:41:04:968 BST [TRACE] HttpMethodBase - -
HttpMethodBase.addRequestHeader(Header)
2006/10/10 15:41:04:968 BST [DEBUG] header - ->> "User-Agent: Jakarta
Commons-HttpClient/3.0.1[\r][\n]"
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.print(String)
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[])
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[], int, int)
2006/10/10 15:41:04:968 BST [DEBUG] header - ->> "Host:
137.205.XX.XX[\r][\n]"
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.print(String)
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[])
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[], int, int)
2006/10/10 15:41:04:968 BST [DEBUG] header - ->> "Proxy-Connection:
Keep-Alive[\r][\n]"
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.print(String)
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[])
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[], int, int)
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.writeLine()
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[])
2006/10/10 15:41:04:968 BST [TRACE] HttpConnection - -enter
HttpConnection.write(byte[], int, int)
2006/10/10 15:41:04:968 BST [DEBUG] header - ->> "[\r][\n]"
2006/10/10 15:41:04:984 BST [TRACE] HttpConnection - -enter
HttpConnection.flushRequestOutputStream()
2006/10/10 15:41:04:984 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.readResponse(HttpState, HttpConnection)
2006/10/10 15:41:04:984 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.readStatusLine(HttpState, HttpConnection)
2006/10/10 15:41:04:984 BST [TRACE] HttpConnection - -enter
HttpConnection.readLine()
2006/10/10 15:41:04:984 BST [TRACE] HttpParser - -enter
HttpParser.readLine (InputStream, String)
2006/10/10 15:41:04:984 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "HTTP/1.0 200
OK[\r][\n]"
2006/10/10 15:41:05:265 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.readResponseHeaders(HttpState,HttpConnection)
2006/10/10 15:41:05:265 BST [TRACE] HttpConnection - -enter
HttpConnection.getResponseInputStream()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HeaderParser.parseHeaders(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readLine(InputStream, String)
2006/10/10 15:41:05:265 BST [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Date: Tue, 10 Oct 2006
14:38:58 GMT[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Content-Type:
text/html;charset=utf-8[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Expires: Tue, 10 Oct
2006 14:38:58 GMT[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Cache-Control:
no-cache[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Server:
Apache-Coyote/1.1[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Pragma:
No-cache[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Set-Cookie:
JSESSIONID=521FF2E618E4FF736DD2F14EDB29A3DC; Path=/[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Content-Language:
en-GB[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Via: 1.1 cache0
(NetCache NetApp/5.3.1R2)[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "X-Cache: MISS from
edcs[\r][\n]"
2006/10/10 15:41:05:265 BST [DEBUG] header - -<< "Proxy-Connection:
close[\r][\n]"
2006/10/10 15:41:05:265 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.processResponseHeaders(HttpState, HttpConnection)
2006/10/10 15:41:05:265 BST [TRACE] CookieSpec - -enter
CookieSpecBase.parse (String, port, path, boolean, String)
2006/10/10 15:41:05:265 BST [TRACE] CookieSpec - -enter
CookieSpecBase.parse(String, port, path, boolean, Header)
2006/10/10 15:41:05:265 BST [TRACE] HeaderElement - -enter
HeaderElement.parseElements(char[])
2006/10/10 15:41:05:296 BST [TRACE] Cookie - -enter Cookie(String,
String, String, String, Date, boolean)
2006/10/10 15:41:05:296 BST [TRACE] CookieSpec - -enter
RFC2109Spec.validate (String, int, String, boolean, Cookie)
2006/10/10 15:41:05:296 BST [TRACE] CookieSpec - -enter
CookieSpecBase.validate(String, port, path, boolean, Cookie)
2006/10/10 15:41:05:296 BST [TRACE] HttpState - -enter
HttpState.addCookie(Cookie)
2006/10/10 15:41:05:296 BST [TRACE] CookieSpec - -enter
RFC2109Spec.formatCookie(Cookie)
2006/10/10 15:41:05:296 BST [DEBUG] HttpMethodBase - -Cookie accepted:
"$Version=0; JSESSIONID=521FF2E618E4FF736DD2F14EDB29A3DC; $Path=/"
2006/10/10 15:41:05:296 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.readResponseBody(HttpState, HttpConnection)
2006/10/10 15:41:05:296 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.readResponseBody(HttpConnection)
2006/10/10 15:41:05:312 BST [TRACE] HttpConnection - -enter
HttpConnection.getResponseInputStream()
2006/10/10 15:41:05:312 BST [TRACE] HttpMethodBase - -enter
HttpMethodBase.canRe
sponseHaveBody(int)
2006/10/10 15:41:05:312 BST [TRACE] HttpState - -enter
HttpState.getCookies()
2006/10/10 15:41:05:312 BST [TRACE] HttpMethodBase -
-HttpMethodBase.addRequestHeader(Header)
2006/10/10 15:41:05:312 BST [TRACE] PostMethod - -enter
PostMethod.addParameter(String, String)
2006/10/10 15:41:05:312 BST [TRACE] EntityEnclosingMethod - -enter
EntityEnclosingMethod.clearRequestBody()
2006/10/10 15:41:05:312 BST [TRACE] PostMethod - -enter
PostMethod.addParameter(String, String)
2006/10/10 15:41:05:312 BST [TRACE] EntityEnclosingMethod - -enter
EntityEnclosingMethod.clearRequestBody()
2006/10/10 15:41:05:312 BST [TRACE] HttpClient - -enter
HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)
2006/10/10 15:41:05:312 BST [TRACE] HttpConnection - -enter
HttpConnection.close()
2006/10/10 15:41:05:312 BST [TRACE] HttpConnection - -enter
HttpConnection.closeSockedAndStreams()
2006/10/10 15:41:05:312 BST [WARN] SimpleHttpConnectionManager -
-SimpleHttpConnectionManager being used incorrectly. Be sure that
HttpMethod.releaseConnection
() is always called and that only one thread and/or method is using this
connection manager at a time.
2006/10/10 15:41:05:312 BST [TRACE] HttpMethodDirector - -Attempt number
1 to process request
2006/10/10 15:41:05:312 BST [TRACE] HttpConnection - -enter
HttpConnection.open()
2006/10/10 15:41:05:312 BST [DEBUG] HttpConnection - -Open connection to
137.205.XX.XX:80
2006/10/10 15:41:26:218 BST [TRACE] HttpConnection - -enter
HttpConnection.closeSockedAndStreams()
2006/10/10 15:41:26:218 BST [DEBUG] HttpMethodDirector - -Closing the
connection.
2006/10/10 15:41:26:218 BST [TRACE] HttpConnection - -enter
HttpConnection.close()
2006/10/10 15:41:26:218 BST [TRACE] HttpConnection - -enter
HttpConnection.closeSockedAndStreams()
2006/10/10 15:41:26:218 BST [INFO] HttpMethodDirector - -I/O exception
(java.net.ConnectException) caught when processing request: Connection
timed out: connect
2006/10/10 15:41:26:218 BST [DEBUG] HttpMethodDirector - -Connection
timed out: connect <java.net.ConnectException: Connection timed out:
connect>java.net.Conne
ctException: Connection timed out: connect
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 java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.crea
teSocket(DefaultProtocolSocketFactory.java:79)
at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.crea
teSocket(DefaultProtocolSocketFactory.java:121)
at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:70
6)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
(HttpMethodDirector.java:386)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMetho
dDirector.java:170)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3
96)
at
com.fact.client.communication.HTTPConnectionController.setup(HTTPConnect
ionController.java:478)
at
com.fact.client.communication.HTTPConnectionController.connect(HTTPConne
ctionController.java :74)
at
com.fact.client.communication.HTTPSession.run(HTTPSession.java:54)
at java.lang.Thread.run(Unknown Source)
2006/10/10 15:41:26:250 BST [INFO] HttpMethodDirector - -Retrying
request