Reputation: 2110
I'm having issues getting aws credentials set up on. I'm getting the same issues on MacOSX and CentOS 6.3. I would prefer to keep the credentials in the ~/.aws/credentials file as mentioned in http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-setup.html#java-dg-install-sdk but after putting the credentials in the form of
[default]
aws_access_key_id = your_access_key_id
aws_secret_access_key = your_secret_access_key
I get this exception
Exception in thread "main" com.amazonaws.AmazonClientException: Unable to load AWS credentials from any provider in the chain
at com.amazonaws.auth.AWSCredentialsProviderChain.getCredentials(AWSCredentialsProviderChain.java:77)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2853)
The java code I am using to set up my s3Client is as follows:
s3Client = new AmazonS3Client(new DefaultAWSCredentialsProviderChain());
Even after setting the credentials file path manually, it's not working either:
export AWS_CREDENTIAL_FILE=/home/myuser/.aws/credentials
Any ideas why this is not working?
Thanks!
Upvotes: 2
Views: 5631
Reputation: 2110
Turns out I had an old version of the aws java sdk in my pom file that I forgot to update. Works great since I updated it to the latest.
Upvotes: 6