来自:http://www.54chen.com/java-ee/java-httpclient-too-many-open-files.html
而http的连接是等待timeout才会自动断开的,所以,当用完系统的句柄后,自然会报Too many open files
解决办法:
设置post方法的header,增加红色字体部分的配置:
HttpClient client = new HttpClient();
client.getParams().setBooleanParameter(
"http.protocol.expect-continue", false);
PostMethod method = new PostMethod(url);
method.addRequestHeader("Connection", "close");