我正在创建一个新的微服务项目。
我正在使用JHipster 4.0.3,根据此问题[https://github.com/jhipster/generator-jhipster/issues/4905] Eureka密码由jhipster.registry.password
定义
因此,在application-dev.yml
Eureka配置默认为:
eureka:
instance:
prefer-ip-address: true
client:
enabled: true
healthcheck:
enabled: true
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/
bootstrap-dev.yml
中的密码定义看起来不错:
jhipster:
registry:
password: admin
当我启动网关(或微服务)时,我收到了此错误消息
2017-02-17 10:32:12.794 ERROR 2064 --- [restartedMain] c.n.d.s.t.d.RedirectingEurekaHttpClient:请求执行错误
java.lang.IllegalArgumentException:索引7的权限中的非法字符:http://admin:$ {jhipster.registry.password} @localhost:8761 / eureka /
在java.net.URI.create(URI.java:852)
at com.sun.jersey.api.client.Client.resource(Client.java:434)
at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.getApplicationsInternal(AbstractJerseyEurekaHttpClient.java:187)
将application-dev.yml
中的Eureka配置更改为:
defaultZone: http://admin:admin@localhost:8761/eureka/
我的配置
由于