简体   繁体   中英

Error finding Aws credential file when uploaded to beanstalk

I am able to use spring mvc with dynamodb and code works fine on localhost with both .aws file under the root app folder ie on same line directory as of src folder and inside the src/resources/.aws/credentials/AWSCredentials.properties .Previously it was working fine on beanstalk too but suddenly it stopped working.I can still render the static pages but as soon as form is submitted it shows this error. And ya when creating a new beanstalk my application shows some error while uploading to s3 but still it gets uploaded .Please details on how do i get it correctly done.Previously it was working fine on the beanstalk too.

medmid.elasticbeanstalk.com clicking arrow button on this page ie submit form will show up the error

Error

HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: AWS credential profiles file not found in the given path: /usr/share/tomcat7/.aws/credentials

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: AWS credential profiles file not found in the given path: /usr/share/tomcat7/.aws/credentials
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:981)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:871)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

After 2 days and all tries of manually uploading file to ec2 instance folder usr/share/tomcat7/.aws/credentials I couldn't find exactly why it couldn't locate my AWSCredentails file ..but this thing replacement worked for me.Maybe useful for someone else too

Instead of writing new ProfileCredentialsProvider() I directly wrote this code so that it does not need to map or find for my files

BasicAWSCredentials credentials = new BasicAWSCredentials("your access key","your secret key"); and then use credentials as parameter instead of new ProfileCredentialsProvider()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM