Questions tagged «google-api-java-client»

9
使用HttpRequest.execute()的异常:无效使用SingleClientConnManager:仍分配了连接
我正在使用google-api-client-java 1.2.1-alpha执行POST请求,并在我执行execute()HttpRequest时得到以下堆栈跟踪信息。 在我捕获并忽略从先前POST到相同URL的403错误并重新用于后续请求的传输之后,它立即发生。(这是将多个条目插入同一ATOM提要的循环)。 403之后,我应该做些什么来“清理”吗? Exception in thread "main" java.lang.IllegalStateException: Invalid use of SingleClientConnManager: connection still allocated. Make sure to release the connection before allocating another one. at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:199) at org.apache.http.impl.conn.SingleClientConnManager$1.getConnection(SingleClientConnManager.java:173) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:390) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554) at com.google.api.client.apache.ApacheHttpRequest.execute(ApacheHttpRequest.java:47) at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:207) at au.com.machaira.pss.gape.RedirectHandler.execute(RedirectHandler.java:38) at au.com.machaira.pss.gape.ss.model.records.TableEntry.executeModification(TableEntry.java:81) 为什么下面的代码会尝试获取新的连接?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.