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

余生颓废 提交于 2019-12-10 12:33:46

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/37689319/what-version-of-httpclient-is-compatible-with-the-amazon-sdk-v-1-11-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!