java.lang.ClassNotFoundException: com.amazonaws.ClientConfigurationFactory

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36796268/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 01:52:51  来源:igfitidea点击:

java.lang.ClassNotFoundException: com.amazonaws.ClientConfigurationFactory

javaamazon-web-servicesamazon-s3amazon-kinesis-firehose

提问by Yubaraj

I am using aws since last 6 months and I developed application that puts batch request to firehose. It was working fine till today but when I redeployed in my local system it is saying java.lang.ClassNotFoundException: com.amazonaws.ClientConfigurationFactory. I know what this error means. But my question is why I got this exception today? I am using following dependency in my project:

自过去 6 个月以来,我一直在使用 aws,并且我开发了将批处理请求发送到 firehose 的应用程序。直到今天它都运行良好,但是当我在本地系统中重新部署时,它说java.lang.ClassNotFoundException: com.amazonaws.ClientConfigurationFactory。我知道这个错误意味着什么。但我的问题是为什么我今天得到这个例外?我在我的项目中使用以下依赖项:

    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk</artifactId>
    <!--    <version>1.10.72</version> --> // I used this version today only for testing purpose
        <version>1.10.6</version>
    </dependency>
    <!-- <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-s3</artifactId>
        <version>1.10.71</version>
    </dependency> -->
    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-core</artifactId>
        <version>1.10.37</version>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-kinesis</artifactId>
        <version>RELEASE</version>
    </dependency>

And I searched ClientConfigurationFactoryclass but don't find anywhere (anywhere means in my dependency).

我搜索了ClientConfigurationFactory课程,但没有找到任何地方(任何地方都意味着我的依赖)。

My question is where is this class located and why I got this error only today? Because I did not face this error in my initial development (6 months before). I have not changed any dependencies/code today. And I am not using this class in my project (I have doubt aws-sdkmay have been using inside).

我的问题是这个班级在哪里,为什么我今天才收到这个错误?因为我在最初的开发中(6 个月前)没有遇到这个错误。我今天没有更改任何依赖项/代码。而且我没有在我的项目中使用这个类(我怀疑aws-sdk可能已经在里面使用了)。

Note: I can not ask Do I missed any dependency?Because it was working fine before.

注意:我不能问我是否错过了任何依赖项?因为之前还好好的。

Please comment if you have any doubt. Thanks.

如果您有任何疑问,请发表评论。谢谢。

回答by Mark B

This is most likely because you have a mismatch of AWS SDK versions you are including. You are using a combination of SDK version 1.10.6, 1.10.71, 1.10.37 and RELEASE. You are asking for trouble mixing the versions like you are doing. Change all those to the same version and your problem will likely go away.

这很可能是因为您包含的 AWS 开发工具包版本不匹配。您正在使用 SDK 版本 1.10.6、1.10.71、1.10.37 和 RELEASE 的组合。您正在要求像您一样混合版本的麻烦。将所有这些更改为相同的版本,您的问题可能会消失。