使用Jersey + AWS S3 sdk时java.lang.NoSuchMethodError:java.lang.NoSuchMethodError:org.apache.http.impl.conn.DefaultClientConnectionOperator

时间:2016-03-10 08:29:26

标签: java amazon-web-services amazon-s3 jersey apache-httpcomponents

我在现有的球衣项目中加入了 aws-java-sdk-s3 依赖项。

我有一个post方法,可以将图像上传到S3。每当我调用AmazonS3Client时,我都会收到此错误。

这是堆栈跟踪。

[org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: org.apache.http.impl.conn.DefaultClientConnectionOperator.<init>(Lorg/apache/http/conn/scheme/SchemeRegistry;Lorg/apache/http/conn/DnsResolver;)V] with root cause
java.lang.NoSuchMethodError: org.apache.http.impl.conn.DefaultClientConnectionOperator.<init>(Lorg/apache/http/conn/scheme/SchemeRegistry;Lorg/apache/http/conn/DnsResolver;)V
    at org.apache.http.impl.conn.PoolingClientConnectionManager.createConnectionOperator(PoolingClientConnectionManager.java:138)
    at org.apache.http.impl.conn.PoolingClientConnectionManager.<init>(PoolingClientConnectionManager.java:112)
    at com.amazonaws.http.ConnectionManagerFactory.createPoolingClientConnManager(ConnectionManagerFactory.java:39)
    at com.amazonaws.http.HttpClientFactory.createHttpClient(HttpClientFactory.java:113)
    at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:217)
    at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:137)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:482)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:462)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:444)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:416)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:398)

然而,当我尝试创建一个没有Jersey依赖项的webapp并通过servlet调用上传图像时,它没有任何错误。

如果我错过了一些依赖项,请告诉我。

0 个答案:

没有答案