Note that there are some explanatory texts on larger screens.

plurals
  1. PO"ConnectionPoolTimeoutException" when iterating objects in S3
    text
    copied!<p>I've been working for some time with aws java API with not so many problems. Currently I'm using the library 1.5.2 version. </p> <p>When I'm iterating the objects inside a folder with the following code:</p> <pre><code>AmazonS3 s3 = new AmazonS3Client(new PropertiesCredentials(MyClass.class.getResourceAsStream("AwsCredentials.properties"))); String s3Key = "folder1/folder2"; String bucketName = Constantes.S3_BUCKET; String key = s3Key +"/input_chopped/"; ObjectListing current = s3.listObjects(new ListObjectsRequest() .withBucketName(bucketName) .withPrefix(key)); boolean siguiente = true; while (siguiente) { siguiente &amp;= current.isTruncated(); contador += current.getObjectSummaries().size(); for (S3ObjectSummary objectSummary : current.getObjectSummaries()) { S3Object object = s3.getObject(new GetObjectRequest(bucketName, objectSummary.getKey())); System.out.println(object.getKey()); } current=s3.listNextBatchOfObjects(current); } </code></pre> <p>Gist: Link: <a href="https://gist.github.com/fgblanch/6038699">https://gist.github.com/fgblanch/6038699</a> I'm getting the following exception:</p> <pre><code>INFO (AmazonHttpClient.java:358) - Unable to execute HTTP request: Timeout waiting for connection from pool org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool at org.apache.http.impl.conn.PoolingClientConnectionManager.leaseConnection(PoolingClientConnectionManager.java:232) at org.apache.http.impl.conn.PoolingClientConnectionManager$1.getConnection(PoolingClientConnectionManager.java:199) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:456) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:315) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:199) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2994) at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:918) at com.madiva.segmentacion.tests.ListaS3.main(ListaS3.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caught an AmazonClientException, which means the client encountered a serious internal problem while trying to communicate with S3, such as not being able to access the network. Error Message: Unable to execute HTTP request: Timeout waiting for connection from pool </code></pre> <p>Any idea how to avoid this error. It only happens in folders with a number of object , in this case there were 463 files inside. Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload