1

I created a jHipster app using this guide, and then created a rds on aws, and set the db url, username and password in the aplication-dev.yml file. When I try to deploy my app to aws with boxfuse using this guide, i get this error.

    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.

How do I solve this problem? How to define the bean described in 'action'? Thanks for your help.

Also, boxfuse creates a rds db even when i type -db.type=none, and i don't know how to disable that option (documentation says with -db.type=none), because I want to use my own db.

Community
  • 1
  • 1
dinooo_06
  • 95
  • 1
  • 8
  • Note -db.type=none must be applied at app creation time and cannot be changed later. So you may need to do a `boxfuse destroy` followed by `boxfuse create -db.type=none` to disable Boxfuse database auto-provisioning. – Axel Fontaine Dec 01 '16 at 17:56
  • @AxelFontaine I solvede my initial problem with deployment. Now, 'boxfuse create -db.type=none' says that 'create' command doesn't exist. When I try with this command 'boxfuse run -env=prod -db.type=none myapp.jar' boxfuse deploys, but creates the db anyway. Should I use db.type=none when i package my app using mvn? Or am I doing this the wrong way from the start? P.S. Thank you for your time. – dinooo_06 Dec 02 '16 at 16:26

1 Answers1

1

I solved my problem with deploying. Only thing I had to change was my procfile. Instead of

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

my procfile now looks like this:

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

I hope this helps someone with similar problems.

dinooo_06
  • 95
  • 1
  • 8