Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 816
Prasanth AV Avatar asked Jan 19 '26 06:01

Prasanth AV


1 Answers

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

like image 119
Prasanth AV Avatar answered Jan 21 '26 20:01

Prasanth AV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!