哪个版本的 httpclient 与 Amazon SDK v 1.11.5 兼容? [英] What version of httpclient is compatible with the Amazon SDK v 1.11.5?

查看:33
本文介绍了哪个版本的 httpclient 与 Amazon SDK v 1.11.5 兼容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Amazon Java SDK,版本 1.11.5(我在我的 WEB-INF/lib 目录中包含了 aws-java-sdk-1.11.5.jar).我需要包含与此版本的 AWS 开发工具包兼容的 Apache httpclient 库的哪个版本?我尝试了 httpclient-4.3.4.jar,但出现以下错误

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

感谢您的额外帮助,-戴夫

解决方案

查看 Java AWS SDK 的源代码,在标签 1.11.5 下,

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

解决方案

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.

这篇关于哪个版本的 httpclient 与 Amazon SDK v 1.11.5 兼容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆