javaamazon-web-servicesamazon-s3amazon-kinesis-firehose

java.lang.ClassNotFoundException: com.amazonaws.ClientConfigurationFactory


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:

    <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 ClientConfigurationFactory class but don't find anywhere (anywhere means in my dependency).

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-sdk may have been using inside).

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

Please comment if you have any doubt. Thanks.


Solution

  • 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.