Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory

Tags:

apache

jar

I keep getting:

Exception in thread "main" 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:50)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:38)
at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:253)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:145)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:136)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:121)
at com.amazonaws.services.elasticmapreduce.AmazonElasticMapReduceClient.<init>(AmazonElasticMapReduceClient.java:175)
at com.amazonaws.services.elasticmapreduce.AmazonElasticMapReduceClient.<init>(AmazonElasticMapReduceClient.java:155)
at ExtractRelatedPairs.main(ExtractRelatedPairs.java:30)

Visual description which illustrates all the added jars (on the left) and their version for inspection.

Despite the fact that all needed jars are added, tried all the different jars and versions, even tried to change project's settings to work with 1.6 1.7 instead of 1.8...

Any ideas?

like image 940
Omayer Gharra Avatar asked Jun 22 '16 22:06

Omayer Gharra


1 Answers

Assuming your project is built with Maven, adding this to your pom.xml should take care of that issue:

<dependency>
  <groupId>org.apache.httpcomponents</groupId>
  <artifactId>httpclient</artifactId>
  <version>4.5.2</version>
</dependency>
like image 69
user1902945 Avatar answered Oct 22 '22 03:10

user1902945