【发布时间】:2019-11-08 13:15:06
【问题描述】:
我有一个单一的 JHipster 应用程序。我已经在.yo-rc.json 中禁用了"serviceDiscoveryType" 到false 但是
当我执行以下命令时
./mvnw -Pprod
我收到此异常
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:138)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:97)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:621)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:365)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
at br.com.pactoebytes.GestaoFranquiasApp.main(GestaoFranquiasApp.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/config/GestaoFranquias/prod/master": Connection refused: connect; nested
e
是错误还是配置问题?
【问题讨论】:
-
所以您禁用了发现,但之后您是否重新生成了您的项目?如果不是,您的 bootstrap.yml 仍然会配置它。
-
@GaëlMarziou 是的,我重新生成了项目,并且 bootstrap.yml 被覆盖了。我需要更改 bootstrap.yml 中的内容吗?
标签: spring-boot jhipster