2016-12-01 58 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 

我希望這可以幫助別人有類似的問題。