question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentials with localstack module and AWS SDK2

See original GitHub issue

When using the AWS SDK v2 the com.amazonaws.auth.AWSCredentials class is not present and a java.lang.NoClassDefFoundError is thrown.

Imho either the local stack module should declare a dependency on the AWS SDK v1 or not use the classes at all. (I’d prefer the latter).

my current workaround, is to add the classes just for tests:

        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-core</artifactId>
            <version>1.11.959</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:28
  • Comments:5

github_iconTop GitHub Comments

4reactions
wjlowcommented, Sep 1, 2021

This is affecting me too

0reactions
jxeromecommented, Sep 9, 2022

I got this issue too !

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NoClassDefFoundError: com/amazonaws/auth ...
lang.NoClassDefFoundError is thrown. Imho either the local stack module should declare a dependency on the AWS SDK v1 or not use the classes...
Read more >
Localstack java.lang.NoClassDefFoundError - Stack Overflow
The code: here i try to make a connection to the local docker with the image of localstack v 0.11.6 and SQS as...
Read more >
LocalStack Module - Testcontainers for Java
Testcontainers module for LocalStack, 'a fully functional local AWS cloud stack', to develop and test your cloud and serverless apps without actually using ......
Read more >
Local Development with AWS on LocalStack - Reflectoring
The SDK provides client libraries in all the popular programming languages like Java, Node js, or Python for accessing various AWS services.
Read more >
Localstack with the AWS SDK for Rust
You can use the Rust SDK with LocalStack by setting a custom endpoint, as shown in the following code example. ... Check crates.io...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found