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
, 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:.
- commons-codec-1.9.jar / commons-codec-1.9-javadoc.jar / commons-codec-1.9-sources.jar
I saw on other threads here that it might be the version of the library
, 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?).
source to share
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.
and it worked.
Other than that, I just solved the exception followed by the import
and it was all running.
source to share