如何禁用jhipster注册表?

3
我使用jhipster注册表生成了单体应用,如何关闭注册表?我可以在DEV配置文件中启动应用程序,但在PROD配置文件中会出现以下错误导致崩溃: java.lang.IllegalStateException: 无法定位PropertySource并且失败快速属性已设置,正在失败。位于org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:132) org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:93) org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567) org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:338) org.springframework.boot.SpringApplication.run(SpringApplication.java:301) com.qitsoftware.arch3d.Arch3DApp.main(Arch3DApp.java:68) Caused by: org.springframework.web.client.ResourceAccessException: GET请求"http://localhost:8761 /config/Arch3D/prod/master"时发生I/O错误:拒绝连接( 拒绝连接);嵌套异常是java.net.ConnectException:拒绝连接(拒绝连接) org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:666) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:613)at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:531) at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:172) at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:93) ... 5 common frames omitted

如果您想完全摆脱注册表,可以通过编辑.yo-rc.json重新生成应用程序,并将更改合并到git存储库中来实现。否则,您可以尝试https://dev59.com/ilsW5IYBdhLWcg3wTlu8 - Gaël Marziou
1个回答

7

通过在bootstrap-prod.yml中禁用云发现并将fail-fast设置为false,找到了解决方案。

spring:
    cloud:
        discovery:
            enabled: false
        config:
            fail-fast: false

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接