What version of httpclient is compatible with the Amazon SDK v 1.11.5?
Asked Answered
V

2

13

I’m using the Amazon Java SDK, version 1.11.5 (I included the aws-java-sdk-1.11.5.jar in my WEB-INF/lib directory). What version of the Apache httpclient library do I need to include that is compatible with this version of the AWS SDK? I tried httpclient-4.3.4.jar, but I get the below error

15:34:25,366 ERROR [io.undertow.request] (default task-34) UT005023: Exception handling request to /pluginwiris_engine/app/service: java.lang.NoSuchMethodError:    org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V
    at com.amazonaws.http.conn.ssl.SdkTLSSocketFactory.<init>(SdkTLSSocketFactory.java:56)
    at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheConnectionManagerFactory.java:87)
    at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:65)
    at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:58)
    at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:46)
    at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:37)
    at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:213)
    at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:145)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:393)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:373)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:355)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:327)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:309)

Thanks for additional help, - Dave

Verdie answered 7/6, 2016 at 21:3 Comment(0)
H
17

Looking at the source for the Java AWS SDK, under tag 1.11.5, you can see the in the POM file they have specified the following:

<httpcomponents.httpclient.version>4.5.2</httpcomponents.httpclient.version>

So I'd say HTTP Client version 4.5.2 is compatible with the AWS SDK version 1.11.5. If you are using a dependency management tool like Maven you could always just let it pull in the version of HTTP Client specified the the AWS SDK.

working combination of libraries

Hosey answered 7/6, 2016 at 21:39 Comment(5)
I tried adding this jar but I still get the same error, was it all you needed to fix it?Bedding
@Bedding you might have another version of httpclient somewhere in your classpath.Mccown
@LizBennett yes, in the end that was the problem the older versions where on the webapp folder in tomcatBedding
Didn't work for me. I took out my http core and http client libs and it still wouldn't fly. I'm also using apache http fluent client, Maybe that's pulling in an incompatible version.Perilune
Thank you. Migrating from httpclient-4.5.13.jar to httpclient-4.5.2.jar fixed the issue for me.Ruthy
Q
0

Look at the compile dependencies at maven repo for aws-java-sdk-core

You can see it's dependent on org.apache.httpcomponents » httpclient -- 4.5.2. Further check if you've all the dependencies of httpclient-4.5.2. You might be missing correct version of httpcore

Quinacrine answered 28/6, 2017 at 21:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.