Tolledo
Tolledo

Reputation: 609

Error starting jHipster Microservices with consul

I'm trying to build sample microservice app using this tutorial. Jhipster version is 4.0.6 So i've created gateway, service and started consul using this command:

docker-compose -f src/main/docker/consul.yml up

from my gateway directory. But the error occur on Spring Boot startup, here is the log:

2017-02-22 11:52:25.679 ERROR 3168 --- [  restartedMain] o.s.c.c.c.ConsulPropertySourceLocator    : Fail fast is set and there was an error reading configuration from consul.

2017-02-22 11:52:32.491  WARN 3168 --- [  restartedMain] o.s.boot.SpringApplication               : Error handling failed (ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2a5b2096: startup date [Thu Jan 01 03:00:00 AST 1970]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@5108df79)
com.ecwid.consul.transport.TransportException: java.net.ConnectException: Connection refused: connect

Could you please assist with this issue?

UPDATE: I've found that app tries to make GET request to URL on staptup:

http://localhost:8500/v1/kv/config/armory,dev/?recurse&token=

But the only data stored in Consul K/V storage is:

KEY: config/application/data

VALUE:
configserver:
    name: Docker Consul Service
    status: Connected to Consul Server running in Docker

jhipster:
    security:
        authentication:
            jwt:
                secret: my-secret-token-to-change-in-production

Upvotes: 1

Views: 2217

Answers (1)

Gaël Marziou
Gaël Marziou

Reputation: 16284

You must copy your application yaml configurations into your consul instance as explained in the doc into central-server-config directory if consul is running in dev profile or in its git repo if consul is running in prod profile.

So assuming your app is named "armory" you should copy your src/main/resources/config/application.yml to armory.yml and for each profiles (e.g. application-dev.yml to armory-dev.yml)

Upvotes: 3

Related Questions