rackspace/java-cloudfiles — Issue #35: Invalid use of SingleClientConnManager
Author: dloehr
Created: 2012-02-10 19:11:19+00:00
State: open

I'm using the Java API to work with CloudFiles, and I often get this exception. I'm attempting to list files that start with a certain prefix (and then download the first match, but I rarely get past the list operation without this exception).

From what I've read online, it seems that this exception can occur when a response isn't read completely before another request is made, or because SingleClientConnManager isn't threadsafe. I'm not aware of the SingleClientConnManager being exposed to me as a user of your Java API, so I don't know if/how I'm supposed to read through the HTTP responses.

Am I doing something wrong, or is this a bug?

13:16:17,672 ERROR ~ Error parsing xml
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:216)
at org.apache.http.impl.conn.SingleClientConnManager$1.getConnection(SingleClientConnManager.java:190)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:401)
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.rackspacecloud.client.cloudfiles.FilesClient.login(FilesClient.java:279)
at com.rackspacecloud.client.cloudfiles.FilesClient.listObjectsStartingWith(FilesClient.java:643)
at utilities.CloudFiles.list(CloudFiles.java:242)