java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.ClientConfiguration

11,744

Solution 1

Thanks for all suggestions

The ClientConfiguration of aws-java-sdk-osgi-1.11.26.jar is dependent of Jackson-databind.jar Jackson-databind.jar is dependent on Jackson-core.jar So it is not able to initialize ClientConfiguration.

Added Import-Package importing all from jackson-core-osgi.jar in Manifest of Jackson-databind-osgi.jar

Then the issue is resolved

Note: All dependent jars are converted to OSGI jars and deployed

Solution 2

Well, make sure that aws-java-sdk-osgi-1.11.26.jar is present on your classpath, because the class itself is present in the jar. I've just downloaded the jar.

aws-java-sdk-osgi-1.11.26.jar

Share:
11,744
Prasanth AV
Author by

Prasanth AV

Updated on June 04, 2022

Comments

  • Prasanth AV
    Prasanth AV almost 2 years

    Using this bundle - aws-java-sdk-osgi-1.11.26.jar in OSGI Server

    Below Error is thrown when this is executed AmazonS3 s3 = new AmazonS3Client( credentials );

    java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.ClientConfiguration
            at com.amazonaws.ClientConfigurationFactory.getDefaultConfig(ClientConfigurationFactory.java:46)
            at com.amazonaws.ClientConfigurationFactory.getConfig(ClientConfigurationFactory.java:36)
            at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:440)
    

    Any solution to fix this?