java - Exception using HttpRequest.execute(): Invalid use of SingleClientConnManager: connection still allocated -
i'm using google-api-client-java 1.2.1-alpha execute post request, , getting following stacktrace when execute() httprequest.
it happens after catch , ignore 403 error previous post same url, , re-used transport subsequent request. (it's in loop inserting multiple entries same atom feed).
is there should doing 'clean up' after 403?
exception in thread "main" java.lang.illegalstateexception: invalid use of singleclientconnmanager: connection still allocated. make sure release connection before allocating one. @ org.apache.http.impl.conn.singleclientconnmanager.getconnection(singleclientconnmanager.java:199) @ org.apache.http.impl.conn.singleclientconnmanager$1.getconnection(singleclientconnmanager.java:173) @ org.apache.http.impl.client.defaultrequestdirector.execute(defaultrequestdirector.java:390) @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:641) @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:576) @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:554) @ com.google.api.client.apache.apachehttprequest.execute(apachehttprequest.java:47) @ com.google.api.client.http.httprequest.execute(httprequest.java:207) @ au.com.machaira.pss.gape.redirecthandler.execute(redirecthandler.java:38) @ au.com.machaira.pss.gape.ss.model.records.tableentry.executemodification(tableentry.java:81)
why code below me trying acquire new connection?
you need consume response body before can reuse connection request. should not read response status, read response inputstream
last byte whereby ignore read bytes.
Comments
Post a Comment