1

我正在使用 DefaultHttpClient 实例执行 HttpPost。并在获得响应后使用它。

如下。(这是一个运行时异常)

httpResponse =  m_httpClient.execute(postRequest);
HttpEntity entity = httpResponse.getEntity();

if (entity != null) {
}
EntityUtils.consume(entity);

我仍然得到例外,

java.lang.IllegalStateException: Manager is shut down.
        at org.apache.http.impl.conn.SingleClientConnManager.assertStillUp(SingleClientConnManager.java:175)
        at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:209)
        at org.apache.http.impl.conn.SingleClientConnManager$1.getConnection(SingleClientConnManager.java:190)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:391)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
        at com.pixalate.etl.adserver.appnexus.api.AppNexusApiManager.executeRequest(AppNexusApiManager.java:374)
4

0 回答 0