Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dependencies #5

Open
9037568 opened this issue Sep 19, 2020 · 4 comments
Open

Missing dependencies #5

9037568 opened this issue Sep 19, 2020 · 4 comments

Comments

@9037568
Copy link

9037568 commented Sep 19, 2020

Attempting to run the code fragment below (based on this AWS example) reveals missing dependencies.

    RdsDataClient client = RdsDataClient.builder().database(Database)
                           .resourceArn(Database_Resource_ARN)
                           .secretArn(Database_Secret_ARN).build();
    client.forSql("select * from accounts").execute().mapToSingle(File.class);

Error message:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Strings
        at com.amazon.rdsdata.client.RdsDataClient.forSql(RdsDataClient.java:97)
        at data1.main(data1.java:15)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Strings
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 2 more
@TheAshwanik
Copy link

1 year later, still seeing this issue, Has anyone managed to fix this?

@sp0l
Copy link

sp0l commented Jan 27, 2022

com.google.common.base.Strings is part of Guava. Guava is already listed in the dependencies section of build.gradle.

@TheAshwanik
Copy link

Yes noticed it. And when I added Guava in my Lambda layer, it still failed. then I added it in individual POM.xml within the different lambdas. It worked.

@sorin-costea
Copy link

Many dependencies of the RDS client are marked as "runtime" thus will be missed at compile time. Maybe that's your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants