java.lang.SecurityException AWSCredentialsProvider Signer Information Does Not Match

Tags: ,



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!

Answer

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



Source: stackoverflow