[英]Cant able to connect to AWS S3 from springboot application
我們正在開發 Spring 啟動應用程序以連接 AWS S3。
final AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
AmazonS3 s3client = AmazonS3ClientBuilder.standard()
.withRegion(Regions.US_WEST_2)
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.build();
在創建 AwsCredentials object 行本身時,我們面臨以下問題
java.lang.SecurityException: class "com.amazonaws.auth.BasicAWSCredentials"'s signer information does not match signer information of other classes in the same package
我們不明白這是什么問題?
所以任何人都知道問題是什么以及如何解決這個問題?
AWS 教程討論了如何從 Spring 啟動應用程序與 Amazon S3 交互。
您的代碼是 V1,所有 AWS 當前教程都是 V2。 我建議將 Java SDK 用於 AWS 版本 2。
這是一個 AWS 教程,向您展示如何創建與 Amazon S3 交互的 Spring 引導應用程序。 除了 S3,此示例應用程序還使用以下 AWS 服務:
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.