Spring AWS:在 Elastic Beanstalk 上部署战争时访问被拒绝错误
Posted
技术标签:
【中文标题】Spring AWS:在 Elastic Beanstalk 上部署战争时访问被拒绝错误【英文标题】:Spring AWS: Access denied error when deploying war on Elastic Beanstalk 【发布时间】:2015-11-12 09:02:30 【问题描述】:在 AWS EB 上使用 Spring AWS 部署战争时,我看到以下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'embeddedServletContainerCustomizerBeanPostProcessor': Initialization of bean failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.annotation.ProxyCachingConfiguration': Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: void org.springframework.cache.annotation.AbstractCachingConfiguration.setConfigurers(java.util.Collection);
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.aws.cache.config.annotation.ElastiCacheCachingConfiguration': Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.cloud.aws.core.env.stack.ListableStackResourceFactory org.springframework.cloud.aws.cache.config.annotation.ElastiCacheCachingConfiguration.stackResourceFactory;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stackResourceRegistryFactoryBean' defined in class path resource [org/springframework/cloud/aws/autoconfigure/context/ContextStackAutoConfiguration$StackAutoDetectConfiguration.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.aws.core.env.stack.config.StackResourceRegistryFactoryBean]: Factory method 'stackResourceRegistryFactoryBean' threw exception;
nested exception is com.amazonaws.AmazonServiceException: User: arn:aws:sts::<id>:assumed-role/aws-elasticbeanstalk-ec2-role/<id> is not authorized to perform: cloudformation:DescribeStackResources (Service: AmazonCloudFormation; Status Code: 403; Error Code: AccessDenied; Request ID: <request-id>)
显示的用户名显然是在此过程中创建的临时用户。 不确定我需要提供哪些信息——请告诉我,我会补充。
谢谢!
【问题讨论】:
【参考方案1】:这显然是由于 spring 配置文件中的问题。某些 xsd URL 无效,因此未使用提供的 aws 凭据。 修复 URL 解决了问题。
【讨论】:
以上是关于Spring AWS:在 Elastic Beanstalk 上部署战争时访问被拒绝错误的主要内容,如果未能解决你的问题,请参考以下文章
将 MongoDB 与 AWS Elastic Bean 应用程序一起使用
使用 AWS Elastic Beanstalk 在 AWS 上部署 Spring Boot 应用程序
在 AWS Elastic BeanStalk 上运行的 Spring Boot 应用程序中配置 AWS RDS
Spring AWS:在 Elastic Beanstalk 上部署战争时访问被拒绝错误