2016-12-01 137 views
1

我使用this指南创建了jHipster应用程序,然后在aws上创建了rds,并在aplication-dev.yml文件中设置了db url,username和password。当我尝试使用this指南将我的应用程序部署到boxfuse的aws时,出现此错误。使用Boxfuse将jHipster部署到aws

ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'accountResource': Unsatisfied dependency expressed through field 'userService'; 
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through field 'jdbcTokenStore'; 
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.security.oauth2.provider.token.store.JdbcTokenStore' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()} 

o.s.boot.SpringApplication: Error handling failed (Error creating bean with name 'delegatingApplicationListener' 
defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: 
BeanPostProcessor before instantiation 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.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available) 

Description: Field jdbcTokenStore in org.foodorder.service.UserService required a bean of type 'org.springframework.security.oauth2.provider.token.store.JdbcTokenStore' that could not be found. 

Action: Consider defining a bean of type 'org.springframework.security.oauth2.provider.token.store.JdbcTokenStore' in your configuration. 

我该如何解决这个问题?如何定义'action'中描述的bean? 感谢您的帮助。

另外,boxfuse甚至当我键入-db.type = none时创建一个rds数据库,并且我不知道如何禁用该选项(文档中用-db.type = none表示),因为我想使用我自己的分贝。

+0

注意-db.type = none必须在应用程序创建时应用,以后不能更改。所以你可能需要做一个'boxfuse destroy'然后用'boxfuse create -db.type = none'来禁用Boxfuse数据库自动配置。 –

+0

@AxelFontaine我解决了我最初的部署问题。现在,'boxfuse create -db.type = none'表示'create'命令不存在。当我尝试使用这个命令'boxfuse run -env = prod -db.type = none myapp.jar'boxfuse部署时,但是无论如何创建db。当我使用mvn打包应用程序时,我应该使用db.type = none吗?或者我从一开始就以错误的方式做这件事? P.S.感谢您的时间。 –

回答

1

我解决了我的部署问题。我唯一需要改变的是我的proc文件。取而代之的

web: java -jar target/*.war --spring.profiles.active=prod,heroku --server.port=$PORT 

我procfile现在看起来是这样的:

web: heroku --server.port=$PORT 
web: java $JAVA_OPTS -Dserver.port=$PORT -Dspring.profiles.active=prod -jar target/*.war 

我希望这可以帮助别人有类似的问题。