spring-boot - JHipster 单体构建生产失败
问题描述
我有一个整体的 JHipster 应用程序。我已经禁用"serviceDiscoveryType"
了false
,.yo-rc.json
但是当我执行以下命令时
./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
是bug还是配置问题?
解决方案
好吧,您可能不需要 a bootstrap.yml
,因为您不使用服务发现或 Spring Cloud 配置服务器(即 JHipster 注册表),因此您的应用程序应该只需要application*.yml
.
尝试删除任何bootstrap*.yml
文件。
项目重新生成不负责删除不需要的文件。
推荐阅读
- javascript - 如何在对象数组上使用 Array.protoype.map() 根据其值过滤掉一些特定的键?
- swift - 我的设备未显示在 Apple Watch (Series 4) 蓝牙设置列表中
- vaadin - 避免在 SplitLayout 中刷新内容
- c# - ConfidentialClientApplication 是否对所有实例都有一个公共缓存?
- java - 如何覆盖 KeyEvent 类的函数?
- spring-boot - 如何将来自客户端的请求转发到在 Windows Server 上运行的 Windows 服务
- ios - 如何从具有多个条件的数组中删除重复项?
- python - 从字符串的开头删除提供的字母列表
- ios - 控制器之间的本地通知传递值在 swift 4.2 中显示错误
- angular - 如何在来自服务器的表单数组中设置值?