On Wed, 2008-06-04 at 09:40 +0200, Martin Zdila wrote:
> Hello
>
> I am using HttpClient 4.0-alpha4 with following settings:
>
> ~~~~~~~~~~~~
> final HttpParams params = new BasicHttpParams();
> HttpConnectionManagerParams.setMaxTotalConnections(params, 100);
> HttpConnectionManagerParams.setMaxConnectionsPerRoute(params, new
> ConnPerRouteBean(20));
> HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
> HttpClientParams.setRedirecting(params, false);
>
> final ClientParamBean paramBean = new ClientParamBean(params);
> paramBean.setAllowCircularRedirects(true);
> paramBean.setHandleAuthentication(false);
> paramBean.setHandleRedirects(false);
>
> // Create and initialize scheme registry
> final SchemeRegistry schemeRegistry = new SchemeRegistry();
> schemeRegistry.register(new Scheme("http",
> PlainSocketFactory.getSocketFactory(), 80));
> schemeRegistry.register(new Scheme("https",
> SSLSocketFactory.getSocketFactory(), 443));
>
> final ClientConnectionManager connectionManager = new
> ThreadSafeClientConnManager(params, schemeRegistry);
>
> client = new DefaultHttpClient(connectionManager, params);
> ((DefaultHttpClient) client).setCookieStore(null); // i don't wan't cookies
> ((DefaultHttpClient) client).setCookieSpecs(null); // i don't wan't cookies
> ~~~~~~~~~~~~
>
> I see often in the logs following messages after executing HTTP method:
>
> INFO org.apache.http.impl.client.DefaultClientRequestDirector - I/O exception
> (org.apache.http.NoHttpResponseException) caught when processing request: The
> target server failed to
> respond
> INFO org.apache.http.impl.client.DefaultClientRequestDirector - Retrying
> request
>
> For HttpGet it finally ends with success, but when this messages appears on
> HttpPost then it ends with following exception:
>
> Caused by: org.apache.http.ProtocolException: Content-Length header already
> present
> at
> org.apache.http.protocol.RequestContent.process(RequestContent.java:70)
> at
> org.apache.http.protocol.BasicHttpProcessor.process(BasicHttpProcessor.java:290)
> at
> org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:160)
> at
> org.apache.http.impl.client.DefaultClientRequestDirector.execute(DefaultClientRequestDirector.java:356)
> at
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:501)
> at
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:456)
> at
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:422)
> ...
>
> Is that a bug? Is there a way to resolve this issue?
>
Martin,
This is clearly a bug. I believe it has already been fixed in the SVN
trunk. Please re-test application with the latest HttpClient snapshot
and let me know if the problem still persists.
Cheers
Oleg
> Thanks in advance.
> Best regards
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]