【发布时间】:2015-03-10 20:47:42
【问题描述】:
大家好,我使用 apache 的 httpclient 进行 restcalls,一切正常,当多个线程使用此方法时,我的应用程序崩溃。 MultithreadSafe 这个类的实现是什么。
这是我的代码。
httpClient = new HttpClient();
HttpMethod method = null;
method = new GetMethod();
... method creation...
httpClient.executeMethod(method);
method.releaseConnection();
提前致谢。娟
【问题讨论】:
-
当你说崩溃时,你有任何堆栈跟踪吗?此外,他们建议重用实例。另外,您配置的池大小是多少?也许也值得一看stackoverflow.com/questions/1281219/…
标签: apache apache-commons apache-commons-httpclient