AWS Java SDK error - java.lang.NoSuchMethodError

I've seen this type of error here for exceptions thrown by different classes, although I haven't found the right solution for mine yet.

I'm trying to get the AWS Java SDK to work locally, so I can write a test application that reads data from a Kinesis stream. The problem is that when I run the static method init()

, I run into the following error:

Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.http.impl.conn.DefaultClientConnectionOperator.<init>
(Lorg/apache/http/conn/scheme/SchemeRegistry;Lorg/apache/http/conn/DnsResolver;)V

      

Now this is not the first error I have chosen. I had four or five exceptions thrown before and the solution for all of them was just importing some jar into the project. eg:.

  • apache-httpcomponents-httpclient.jar
  • com.fasterxml.jackson.databind.jar
  • commons-codec-1.9.jar / commons-codec-1.9-javadoc.jar / commons-codec-1.9-sources.jar
  • HttpClient-4.2.jar
  • httpcore-4.0.1.jar

I saw on other threads here that it might be the version of the library httpcore

, however I imported the last one.

Any ideas how I can solve this? I'm thinking about getting started, since my project seems to have a bunch of imports, I'm not sure which one I'm actually using. Also, I am unable to debug the AWS SDK binary import (or can I?).

Greetings.

+3


source to share


1 answer


Problem solved, I was gradually adding missing libraries to the project, and when the apache httpclient jar needs to be version 4.0 or newer and without any previous version to contradict.

I imported httpclient-4.2.jar

and it worked.



Other than that, I just solved the exception followed by the import joda-time-2.4.jar

and it was all running.

+2


source







All Articles