hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "N V Kameshwara Rao" <kamesh.nitt...@applabs.net>
Subject RE: Connection Reset by server
Date Thu, 10 Feb 2005 04:34:46 GMT
Hi ,

  One question on this point ...
  What is the difference with  setting the DefaultHttpMethodRetryHandler at
the client level like what Nit did
and having a HttpMethodRetryHandler at the method level?
   Is there any difference to the idempotency of the method?
thanks,
Kamesh


-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org]
Sent: Thursday, February 10, 2005 2:38 AM
To: HttpClient User Discussion
Cc: Nittala
Subject: Re: Connection Reset by server


Nit,

Please take a look at the HttpClient exception handling guide for some
info on this problem and possible solutions:

http://jakarta.apache.org/commons/httpclient/3.0/exception-
handling.html#HTTP%20transport%20safety

Hope this helps

Oleg


On Thu, 2005-02-03 at 04:11 -0800, Nittala wrote:
> Hi,
>   Am using the Httpclient 3.0 with the
> MultiThreadedConnectionManager. My server is Weblogic
> 8.1 and the time out for idle connections is set to 60
> seconds in weblogic.
>
>   However, when i try to communicate from my client
> (Java Web Start using JDK1.3.1 Runtime), i often get
> the Connection reset by peer _JVM exception.
>
> The code that i am using looks something like this.
>
>
> mthcm = new MultiThreadedHttpConnectionManager();
> client = new HttpClient(mthcm);
> client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
> client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
> new DefaultHttpMethodRetryHandler(4,false));
>
>
> PostMethod   method =null;
>
> try{
> 	method = new PostMethod(url);
>
> 	NameValuePair nvp = new NameValuePair("query",
> input);
>
> 	method.addParameter(nvp);
>
>
> 	int status = client.executeMethod(method);
>
>
> 	if (status == HttpStatus.SC_OK) {
>                 InputStream ins =
> method.getResponseBodyAsStream();
> 		ObjectInputStream objectinputstream = new
> ObjectInputStream(ins);
> 		obj = objectinputstream.readObject();
> 		objectinputstream.close();
> 		ins.close();
> 	}else{
> 	   method.getResponseBody();
> 	}
> }finally {
> 	if (method != null)
> 		method.releaseConnection();
> 	return obj;
> }
>
>
>
> Any pointer on where i am doing wrong will be of great
> help.
> thanks all,
> Nit Tala
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Find what you need with new enhanced search.
> http://info.mail.yahoo.com/mail_250
>
> ---------------------------------------------------------------------
> 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


---------------------------------------------------------------------
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