简体   繁体   English

将AWS凭证文件上传到beantalk时发现错误

[英]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. 我能够将spring mvc与dynamodb一起使用,并且代码在localhost上工作正常,在.apps根应用程序文件夹下,即与src文件夹位于同一行目录中,并且在src / resources / .aws / credentials / AWSCredentials.properties中。以前它在beantalk上也能正常工作,但是突然停止了工作。我仍然可以渲染静态页面,但是一旦提交表单,它就会显示此错误。 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. 而且当创建一个新的beantalk时,我的应用程序在上传到s3时显示了一些错误,但仍然被上传。请详细说明如何正确完成它。以前它在beantalk上也可以正常工作。

medmid.elasticbeanstalk.com clicking arrow button on this page ie submit form will show up the error medmid.elasticbeanstalk.com单击此页面上的箭头按钮,即提交表单将显示错误

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 2天后,所有尝试将文件手动上传到ec2实例文件夹usr/share/tomcat7/.aws/credentials尝试,我都找不到确切的原因,为什么它找不到我的AWSCredentails文件..对别人也有用

Instead of writing new ProfileCredentialsProvider() I directly wrote this code so that it does not need to map or find for my files 我没有编写new ProfileCredentialsProvider()而是直接编写了此代码,因此不需要为我的文件进行映射或查找。

BasicAWSCredentials credentials = new BasicAWSCredentials("your access key","your secret key"); and then use credentials as parameter instead of new ProfileCredentialsProvider() 然后使用credentials作为参数代替new ProfileCredentialsProvider()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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