0

we are working on Spring boot applicaation to connect with AWS S3.

  final AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);


        AmazonS3 s3client = AmazonS3ClientBuilder.standard()
                .withRegion(Regions.US_WEST_2)
                .withCredentials(new AWSStaticCredentialsProvider(credentials))
                .build();

while creating the AwsCredentials object line itself we facing the below issue

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

we didn't understand what is the issue?

so anyone know what is the issue and how to resolve this?

RandomUser
  • 31
  • 1
  • 8

1 Answers1

0

There are AWS Tutorials that discuss how to interact with Amazon S3 from a Spring boot application.

You code is V1 and all AWS current tutorials are V2. I recommend using the Java SDK for AWS Version 2.

Here is an AWS Tutorial that shows you how to create a Spring Boot application that does interact with Amazon S3. In addition to S3, this example app also uses these AWS services:

  • Amazon Rekognition
  • Amazon SES
  • AWS Elastic Beanstalk

To learn how to use the AWS SDK for Java V2 to develop a Spring Boot application that invokes Amazon S3 and other services, see this URL: https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/usecases/creating_photo_analyzer_app

smac2020
  • 9,637
  • 4
  • 24
  • 38