【发布时间】:2017-07-12 05:44:31
【问题描述】:
我正在尝试使用此tutorial 构建示例微服务应用程序。 Jhipster 版本是 4.0.6 所以我创建了网关、服务并使用这个命令启动了领事:
docker-compose -f src/main/docker/consul.yml up
来自我的网关目录。 但是Spring Boot启动时出现错误,日志如下:
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
您能帮忙解决这个问题吗?
更新: 我发现该应用程序尝试在 staptup 上向 URL 发出 GET 请求:
http://localhost:8500/v1/kv/config/armory,dev/?recurse&token=
但 Consul K/V 存储中存储的唯一数据是:
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
【问题讨论】:
标签: spring-boot spring-cloud jhipster consul