hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Connection Reset by server
Date Wed, 09 Feb 2005 21:07:47 GMT
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


Mime
View raw message