我正在尝试为托管在云(Pivotal Web 服务)上的 Spring boot maven 应用程序提供凭据,以便能够上传到 Amazon S3。但是,每次我尝试使用以下方式获取凭据时:
DefaultAWSCredentialsProviderChain credentialProviderChain = new DefaultAWSCredentialsProviderChain();
TransferManager transferManager = new TransferManager(credentialProviderChain.getCredentials());
它说
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
[Request processing failed; nested exception is com.amazonaws.AmazonClientException: Unable
to load AWS credentials from any provider in the chain] with root cause
2016-01-28T23:55:38.55+0000 [APP/0] OUT com.amazonaws.AmazonClientException:
Unable to load AWS credentials from any provider in the chain
对于我的凭据是否应该在 beans.xml 或 application.properties 文件中定义,我有点困惑。但是我两个都试过了,都无济于事。有人能指出我正确的方向吗?