Skip to content

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

Open
@NathanEckert

Description

@NathanEckert

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions