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

Drivers still requires classes from AWS SDK v1 for IAM identification #120

Open
NathanEckert opened this issue Jul 1, 2024 · 3 comments

Comments

@NathanEckert
Copy link

NathanEckert commented Jul 1, 2024

Driver version

2.1.0.29

Redshift version

Client Operating System

Linux Ubuntu 22.04.4 LTS

JAVA/JVM version

openjdk 21.0.3 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)

Problem description

When migrating to AWS SDK v2 following the end-of-support announcement (https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-java-v1-x-on-december-31-2025/), I noticed that the JDBC driver still requires one Java SDK v1 class when using IAM

Reproduction code

I tried to remove from my pom the following artifact

<dependency>
  <groupId>com.amazonaws</groupId>
  <artifactId>aws-java-sdk-redshift</artifactId>
</dependency>

I even tried to replace it with the v2 version:

<dependency>
   <groupId>software.amazon.awssdk</groupId>
  <artifactId>redshift</artifactId>
</dependency>

But when running code using IAM identification, I get the following stacktrace:

java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentials

	at com.amazon.redshift.jdbc.RedshiftConnectionImpl.<init>(RedshiftConnectionImpl.java:284)
	at com.amazon.redshift.Driver.makeConnection(Driver.java:483)
	at com.amazon.redshift.Driver.connect(Driver.java:304)
@brianwyka
Copy link

I just noticed the same thing.

@ShuuyaMonzen
Copy link

I have the same problem.
My project is a Java17, Gradle-based project

@matt-brewster
Copy link

I'm getting a slightly different error but I think it's the same root cause:

java.lang.NoClassDefFoundError: com/amazonaws/services/redshift/AmazonRedshiftClientBuilder
	at com.amazon.redshift.jdbc.RedshiftConnectionImpl.<init>(RedshiftConnectionImpl.java:287) ~[redshift-jdbc42-2.1.0.30.jar:na]
	at com.amazon.redshift.Driver.makeConnection(Driver.java:483) ~[redshift-jdbc42-2.1.0.30.jar:na]
	at com.amazon.redshift.Driver.connect(Driver.java:304) ~[redshift-jdbc42-2.1.0.30.jar:na]

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