AWS Java SDK错误

编程入门 行业动态 更新时间:2024-10-08 14:44:37
本文介绍了AWS Java SDK错误-java.lang.NoSuchMethodError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

尽管我还没有找到适合我的正确解决方案,但我已经在这里看到了由各种类引发的异常的此类错误.

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.

我正在尝试使AWS Java SDK在本地工作,因此我可以编写一个测试应用程序,以从Kinesis流中读取数据. 问题是,当我运行init()静态方法时,遇到以下错误:

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

现在,这不是我抛出的第一个错误.在此之前,我已经被抛出了四个或五个异常,而所有这些异常的解决方案只是将一些jar导入到项目中.例如:

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

我在附近的其他线程中看到它可能是httpcore库的版本,但是我导入了最新的库.

I've seen in other threads around here that it could be the version of the httpcore library, however I imported the latest one.

有什么想法可以解决这个问题吗?我正在考虑重新开始,因为我的项目似乎是很多进口商品,但我不确定我是否会真正利用它.此外,我无法调试AWS开发工具包的二进制导入(还是不能?).

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?).

干杯.

推荐答案

问题解决了,我逐渐将缺少的库添加到项目中,并且当apache httpclient jar版本为4.0或更高版本时,没有任何先前版本相矛盾.

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.

我导入了httpclient-4.2.jar并且有效.

除此之外,我只是解决了导入joda-time-2.4.jar之后的异常,它已全部启动并运行.

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

更多推荐

AWS Java SDK错误

本文发布于:2023-11-25 11:43:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629608.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   AWS   Java   SDK

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!