3

I've seen this type of error over here for exceptions that are thrown by various classes, though I haven't found the right solution for mine just yet.

I'm trying to get AWS Java SDK work locally so I can write a test application that reads data from a Kinesis stream. Problem is, when I run the init() static method I encounter 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've been thrown. I've been thrown four or five exceptions prior to this one, and the solution to all of them was just importing some jar's into the project. e.g.:

  • 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've seen in other threads around here that it could be the version of the httpcore library, however I imported the latest one.

Any ideas how I can resolve this? I'm thinking about starting over, as my project seems to be a heap of imports I'm not sure I'll actually utilize. Furthermore, I can't debug the binary imports of the AWS SDK (or can't I?).

Cheers.

3
  • OK, so minor advancement, I had such a jolly time importing all those jar's that I had contradictions between two versions of the apache HTTP core. I'll carry on and will post progress. Commented Sep 11, 2014 at 6:52
  • 1
    You're using Tomcat right? If that is the case, find which JAR contains the class which it can't find (you can use a ZIP program to check the contents of JAR's) then try placing the JAR in different include folders. ie. \Tomcat\Lib or \webapps\myapp\WEB-INF\lib, etc depending on your version of Tomcat there may be other folders to "try". Commented Sep 11, 2014 at 7:00
  • Thank you munyul, issue resolved by removing the obsolete version of the httpclient library which interrupted. Then just added a missing joda-time package and the problem was resolved. Commented Sep 11, 2014 at 7:04

1 Answer 1

3

Problem solved, I gradually added the missing libraries to the project and when the apache httpclient jar should be version 4.0 or later, and without any previous version to contradict.

I imported httpclient-4.2.jar and it worked.

Other than that, I just solved the exception that followed by importing joda-time-2.4.jar and it's all up and running.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.