3
时为什么HttpClient的抛出SocketTimeOutException我有类似下面的代码:执行POST
try {
HttpPost post = new HttpPost(httpsUrl);
setHeaders(post);
HttpEntity entity = new StringEntity(request, "UTF-8");
post.setEntity(entity);
HttpResponse response = httpclient.execute(post);
String result = EntityReader.readContent(response.getEntity());
checkAnswer(result);
return result;
} catch (Exception e) {
throw new ZapException("Error executing the http post request: "+e.getMessage(), e);
}
它发出的request
到服务器通过POST使用HttpClient的实例内容可能已被使用过(它已经打开了持续连接,因为我们向相同的服务器发送了一些请求......)。
这个有时失败,SocketTimeoutException
与“读取超时”作为消息。 我们不清楚,为什么它只是在某些时候失败,而大部分时候没有。是什么赋予了?
当发送多个请求到solr w/tomcat 7时,我有一个类似的问题。你是什么发送请求?什么是你的服务器的细节,因为那里的错误来自 – 2011-05-23 05:01:26
我认为这是Jetty 6.但那是一段时间后... – kungfoo 2011-05-23 10:55:41