Deploy jHipster with Boxfuse to aws

Refresh

April 2019

Views

154 time

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.

1 answers

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.