5

I am using 2 Amazon-provided libraries: redshift-jdbc42-1.2.27.1051 and aws-java-sdk-core-1.11.600. Both libraries define a class AWSCredentialsProvider under package com.amazonaws.auth. When I'm trying to use my app, I get this Exception:

Caused by: java.lang.SecurityException: class "com.amazonaws.auth.AWSCredentialsProvider"'s signer information does not match signer information of other classes in the same package

I am not sure how to resolve this. Any help would be appreciated!

Stefan Zhelyazkov
  • 2,599
  • 4
  • 16
  • 41

2 Answers2

3

I found that on Amazon's documentation for the Redshift JDBC driver, they say:

If you use the Amazon Redshift JDBC driver for database authentication, you must have AWS SDK for Java 1.11.118 or later in your Java class path. If you don't have AWS SDK for Java installed, you can use a driver that includes the AWS SDK.

The issue was arising from the fact that now I have AWS SDK components provided by both libraries. Now, I don't need the AWS SDK packaged with the driver, since I can use it from the AWS S3 SDK. In fact, Amazon encourages developers to use a Redshift JDBC driver without a pre-packaged SDK:

Important

We strongly recommend using an Amazon Redshift JDBC driver that doesn't include the AWS SDK if possible.

If you run into this problem and are downloading the dependency from Maven, you can find a non-aws-sdk driver here: https://mvnrepository.com/artifact/com.amazon.redshift/redshift-jdbc42-no-awssdk

Stefan Zhelyazkov
  • 2,599
  • 4
  • 16
  • 41
1

You can use the same aws-java-sdk-core-1.11.***.jar which is mentioned in Athena's jdbc jar file. To find athena's sdk version, extract AthenaJDBC42.jar file, you can find the version in pom file \AthenaJDBC42\META-INF\maven\com.amazonaws\aws-java-sdk-core\pom.properties.

#Generated by Maven
#Tue Jun 02 12:03:54 IST 2020
**version=1.11.793**
groupId=com.amazonaws
artifactId=aws-java-sdk-core

Use the same version of aws-java-sdk-core-1.11.793.jar while connecting to S3 bucket would solve that issue.

Hitesh Mundra
  • 1,538
  • 1
  • 9
  • 13