错误信息
[WARN ] 2012-04-25 16:20:11,728 method:org.apache.commons.httpclient.SimpleHttpConnectionManager.getConnectionWithTimeout(SimpleHttpConnectionManager.java:204)
SimpleHttpConnectionManager being used incorrectly. Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.
在创建httpclient对象的时候,默认使用simpleHttpConnectionManager作为连接管理,而它不适合多线程环境。故修正方法是:自己创建httpclient对象,并指定适合多线程环境的连接管理器。
HttpClient httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());