hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject Re: "Connection reset by peer" from a single server
Date Wed, 03 Aug 2005 12:06:48 GMT
Hi Michael,

there's not much to work with here.
Have you tried to set the "User-Agent" header
to some browser's standard value? Some
servers will only accept known user agents.

hope that helps,
  Roland




"Michael Mattox" <michael@verideon.com> 
03.08.2005 13:47
Please respond to
"HttpClient User Discussion"


To
httpclient-user@jakarta.apache.org
cc

Subject
"Connection reset by peer" from a single server






We're trying to get our client code (using HTTPClient) working with our
customer's server.  We constantly get SocketException connection reset by
peer.  We tried other URLs (other servers) and it works fine.  Then we
used "curl" to try our customer's URL and that works fine.  It just seems
like there is an incompatibility between HttpClient & our customer's http
server.  Here is the trace log, if you see anything or have any
suggestions please let me know:

2005/08/03 12:08:40:030 CEST [DEBUG] DefaultHttpParams - Set parameter
http.useragent = Jakarta Commons-HttpClient/3.0-rc3
2005/08/03 12:08:40:060 CEST [DEBUG] DefaultHttpParams - Set parameter
http.protocol.version = HTTP/1.1
2005/08/03 12:08:40:070 CEST [DEBUG] DefaultHttpParams - Set parameter
http.connection-manager.class = class
org.apache.commons.httpclient.SimpleHttpConnectionManager
2005/08/03 12:08:40:070 CEST [DEBUG] DefaultHttpParams - Set parameter
http.protocol.cookie-policy = rfc2109
2005/08/03 12:08:40:070 CEST [DEBUG] DefaultHttpParams - Set parameter
http.protocol.element-charset = US-ASCII
2005/08/03 12:08:40:070 CEST [DEBUG] DefaultHttpParams - Set parameter
http.protocol.content-charset = ISO-8859-1
2005/08/03 12:08:40:070 CEST [DEBUG] DefaultHttpParams - Set parameter
http.method.retry-handler =
org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@81d1b70
2005/08/03 12:08:40:070 CEST [DEBUG] DefaultHttpParams - Set parameter
http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy
HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE,
dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy
HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE
dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z,
EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]
2005/08/03 12:08:40:130 CEST [TRACE] GetMethod - enter GetMethod(String)
2005/08/03 12:08:40:140 CEST [DEBUG] HttpClient - Java version: 1.5.0_02
2005/08/03 12:08:40:140 CEST [DEBUG] HttpClient - Java vendor: Sun
Microsystems Inc.
2005/08/03 12:08:40:140 CEST [DEBUG] HttpClient - Java class path:
/users/edacosta/dev/project-socle/bin:/users/edacosta/tomcat/common/lib/servlet-api.jar:/users/edacosta/dev/project-socle/lib/commons-collections-3.1.jar:/users/edacosta/dev/project-socle/lib/commons-digester-1.7.jar:/users/edacosta/dev/project-socle/lib/commons-lang-2.1.jar:/users/edacosta/dev/project-socle/lib/commons-logging-1.0.4.jar:/users/edacosta/dev/project-socle/lib/dom4j-1.6.1.jar:/users/edacosta/dev/project-socle/lib/hivemind-1.1-beta-2.jar:/users/edacosta/dev/project-socle/lib/hivemind-jmx-1.1-beta-2.jar:/users/edacosta/dev/project-socle/lib/hivemind-lib-1.1-beta-2.jar:/users/edacosta/dev/project-socle/lib/javassist-3.0.jar:/users/edacosta/dev/project-socle/lib/jipae-06302005.jar:/users/edacosta/dev/project-socle/lib/junit-3.8.1.jar:/users/edacosta/dev/project-socle/lib/log4j-1.2.9.jar:/users/edacosta/dev/project-socle/lib/oro-2.0.8.jar:/users/edacosta/dev/project-socle/lib/servlet-api-5.5.9.jar:/users/edacosta/dev/project-socle/lib/struts-1.2.7.jar:/users/edacos!
ta/dev/project-socle/lib/commons-beanutils-1.7.0.jar:/users/edacosta/dev/project-socle/lib/commons-httpclient-3.0-rc3.jar:/users/edacosta/dev/project-socle/lib/commons-codec-1.3.jar:/users/edacosta/dev/project-socle/lib/xerces-2.7.0.jar:/users/edacosta/eclipse/plugins/org.eclipse.jdt.junit_3.1.0/junitsupport.jar:/users/edacosta/eclipse/plugins/org.eclipse.jdt.junit.runtime_3.1.0/junitruntime.jar
2005/08/03 12:08:40:140 CEST [DEBUG] HttpClient - Operating system name:
Linux
2005/08/03 12:08:40:140 CEST [DEBUG] HttpClient - Operating system
architecture: i386
2005/08/03 12:08:40:140 CEST [DEBUG] HttpClient - Operating system
version: 2.4.21-32.EL
2005/08/03 12:08:40:610 CEST [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)
2005/08/03 12:08:40:610 CEST [DEBUG] HttpClient - SunRsaSign 1.5: Sun RSA
signature provider
2005/08/03 12:08:40:610 CEST [DEBUG] HttpClient - SunJSSE 1.5: Sun JSSE
provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
2005/08/03 12:08:40:610 CEST [DEBUG] HttpClient - SunJCE 1.5: SunJCE
Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2,
PBE, Diffie-Hellman, HMAC)
2005/08/03 12:08:40:610 CEST [DEBUG] HttpClient - SunJGSS 1.0: Sun
(Kerberos v5)
2005/08/03 12:08:40:610 CEST [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)
12:08:40,630 [U:            ] [Main Thread         ] DEBUG
SBContextePubliciteImpl      - requete Http : query null
2005/08/03 12:08:40:650 CEST [TRACE] HttpClient - enter
HttpClient.executeMethod(HttpMethod)
2005/08/03 12:08:40:650 CEST [TRACE] HttpClient - enter
HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)
12:08:40,650 [U:            ] [Main Thread         ] DEBUG
SBContextePubliciteImpl      - requete Http : URI
envoyehttp://server.client.fr/RealMedia/ads/adstream_sx.ads/www.client.fr/b003410@Top
2005/08/03 12:08:40:690 CEST [TRACE] HttpMethodDirector - Attempt number 1
to process request
2005/08/03 12:08:40:690 CEST [TRACE] HttpConnection - enter
HttpConnection.open()
2005/08/03 12:08:40:690 CEST [DEBUG] HttpConnection - Open connection to
server.client.fr:80
2005/08/03 12:08:40:790 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.execute(HttpState, HttpConnection)
2005/08/03 12:08:40:800 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.writeRequest(HttpState, HttpConnection)
2005/08/03 12:08:40:800 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.writeRequestLine(HttpState, HttpConnection)
2005/08/03 12:08:40:800 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.generateRequestLine(HttpConnection, String, String, String,
String)
2005/08/03 12:08:40:810 CEST [DEBUG] header - >> "GET
/RealMedia/ads/adstream_sx.ads/www.client.fr/b003410@Top HTTP/1.1[\r][\n]"
2005/08/03 12:08:40:810 CEST [TRACE] HttpConnection - enter
HttpConnection.print(String)
2005/08/03 12:08:40:810 CEST [TRACE] HttpConnection - enter
HttpConnection.write(byte[])
2005/08/03 12:08:40:810 CEST [TRACE] HttpConnection - enter
HttpConnection.write(byte[], int, int)
2005/08/03 12:08:40:810 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
2005/08/03 12:08:40:810 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)
2005/08/03 12:08:40:810 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection)
2005/08/03 12:08:40:810 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)
2005/08/03 12:08:40:820 CEST [DEBUG] HttpMethodBase - Adding Host request
header
2005/08/03 12:08:40:820 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)
2005/08/03 12:08:40:830 CEST [TRACE] HttpState - enter
HttpState.getCookies() 2005/08/03 12:08:40:830 CEST [TRACE] CookieSpec -
enter
CookieSpecBase.match(String, int, String, boolean, Cookie[])
2005/08/03 12:08:40:840 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.addProxyConnectionHeader(HttpState, HttpConnection)
2005/08/03 12:08:40:840 CEST [DEBUG] header - >> "User-Agent: Jakarta
Commons-HttpClient/3.0-rc3[\r][\n]"
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.print(String)
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.write(byte[])
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.write(byte[], int, int)
2005/08/03 12:08:40:840 CEST [DEBUG] header - >> "Host:
server.client.fr[\r][\n]"
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.print(String)
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.write(byte[])
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.write(byte[], int, int)
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.writeLine()
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.write(byte[])
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.write(byte[], int, int)
2005/08/03 12:08:40:840 CEST [DEBUG] header - >> "[\r][\n]"
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.flushRequestOutputStream()
2005/08/03 12:08:40:840 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.readResponse(HttpState, HttpConnection)
2005/08/03 12:08:40:840 CEST [TRACE] HttpMethodBase - enter
HttpMethodBase.readStatusLine(HttpState, HttpConnection)
2005/08/03 12:08:40:840 CEST [TRACE] HttpConnection - enter
HttpConnection.readLine()
2005/08/03 12:08:40:840 CEST [TRACE] HttpParser - enter
HttpParser.readLine(InputStream, String)
2005/08/03 12:08:40:850 CEST [TRACE] HttpParser - enter
HttpParser.readRawLine()
2005/08/03 12:08:40:920 CEST [DEBUG] HttpMethodDirector - Closing the
connection.
2005/08/03 12:08:40:920 CEST [TRACE] HttpConnection - enter
HttpConnection.close()
2005/08/03 12:08:40:920 CEST [TRACE] HttpConnection - enter
HttpConnection.closeSockedAndStreams()
2005/08/03 12:08:40:920 CEST [DEBUG] HttpMethodDirector - Method retry
handler returned false. Automatic recovery will not be attempted
2005/08/03 12:08:40:920 CEST [TRACE] HttpConnection - enter
HttpConnection.releaseConnection()
2005/08/03 12:08:40:920 CEST [DEBUG] HttpConnection - Releasing connection
back to connection manager.
12:08:40,920 [U:            ] [Main Thread         ] ERROR
SBContextePubliciteImpl      - erreur lors de l'envoi de la requete Http
java.net.SocketException: Connection reset by peer
                 at 
jrockit.net.SocketNativeIO.read(Ljava.io.FileDescriptor;III)I(Unknown
Source)
                 at java.net.AbstractSocketImpl$1.read(II)I(Unknown 
Source)
                 at jrockit.io.NativeIOInputStream.read(I[BI)I(Unknown 
Source)
                 at jrockit.io.NativeIOInputStream.read([BII)I(Unknown 
Source)
                 at 
java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at
java.io.BufferedInputStream.read(BufferedInputStream.java:235) at
org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)
at
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1110)
                 at
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)
                 at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1592)
                 at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
                 at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:393)
                 at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
                 at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
                 at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
                 at
fr.client.commun.base.impl.SBContextePubliciteImpl.envoieRequeteHttp(SBContextePubliciteImpl.java:100)
                 at
fr.client.commun.base.impl.SBContextePubliciteImpl.recupereBandeauPublicitaireMl(SBContextePubliciteImpl.java:43)
                 at
fr.client.commun.base.impl.SBContextePubliciteImplTest.testRecupereBandeauPublicitaireMl(SBContextePubliciteImplTest.java:61)
                 at
jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
Source)
                 at
jrockit.reflect.InitialMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
Source)
                 at
java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown
Source)
                 at junit.framework.TestCase.runTest(TestCase.java:154)
                 at junit.framework.TestCase.runBare(TestCase.java:127)
                 at 
junit.framework.TestResult$1.protect(TestResult.java:106)
                 at 
junit.framework.TestResult.runProtected(TestResult.java:124)
                 at junit.framework.TestResult.run(TestResult.java:109)
                 at junit.framework.TestCase.run(TestCase.java:118)
                 at junit.framework.TestSuite.runTest(TestSuite.java:208)
2005/08/03 12:08:40:930 CEST [TRACE] HttpConnection - enter
HttpConnection.releaseConnection()
2005/08/03 12:08:40:930 CEST [DEBUG] HttpConnection - Releasing connection
back to connection manager.






--
This E-mail is confidential.  It may also be legally privileged.  If you 
are
not the addressee you may not copy, forward, disclose or use any part of 
it.
If you have received this message in error, please delete it and all 
copies
from your system and notify the sender immediately by return E-mail.
Internet communications cannot be guaranteed to be timely, secure, error 
or
virus-free.  The sender does not accept liability for any errors or 
omissions.


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




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


Mime
View raw message