简体   繁体   English

无法从 'optional:configserver:http://localhost:8090 - SpringBoot 2.4.0 Illford 2020.0.0-M3 加载配置数据

[英]Unable to load config data from 'optional:configserver:http://localhost:8090 - SpringBoot 2.4.0 Illford 2020.0.0-M3

Question regarding the new SpringBoot 2.4.0 please.请提出有关新 SpringBoot 2.4.0 的问题。

First, we upgraded our Config Server and Config Client to SpringBoot 2.4.0 + Illford 2020.0.0-M3首先,我们将 Config Server 和 Config Client 升级到 SpringBoot 2.4.0 + Illford 2020.0.0-M3

Then, we followed the "new way" of setting properties https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4 and would like to stick with this new way.然后,我们遵循了设置属性的“新方法” https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4并想坚持这个新方法。

Hence, I configured this in our application.properties (please see the spring.config.import )因此,我在 application.properties 中配置了它(请参阅spring.config.import

server.port=8010
spring.application.name=mycoolservice
spring.config.import=optional:configserver:${SPRING_CLOUD_CONFIG_URI:https://localhost:8090}/config

Then, we deleted our old but working bootstrap.properties然后,我们删除了旧的但有效的 bootstrap.properties

server.port=8010
spring.application.name=mycoolservice
spring.cloud.config.uri=${SPRING_CLOUD_CONFIG_URI:https://localhost:8090}/config
spring.profiles.active=${SPRING_PROFILE_ACTIVE:local}

Finally, we started the app and observed:最后,我们启动了应用程序并观察到:

 ERROR [,,] 31987 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: Unable to load config data from 'optional:configserver:https://localhost:8090/config'
    at org.springframework.boot.context.config.StandardConfigDataLocationResolver.getReferences(StandardConfigDataLocationResolver.java:124) ~[spring-boot-2.4.0.jar:2.4.0]
    at org.springframework.boot.context.config.StandardConfigDataLocationResolver.resolve(StandardConfigDataLocationResolver.java:111) ~[spring-boot-2.4.0.jar:2.4.0]
    at org.springframework.boot.context.config.ConfigDataLocationResolvers.lambda$resolve$1(ConfigDataLocationResolvers.java:114) ~[spring-boot-2.4.0.jar:2.4.0]
    at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:125) ~[spring-boot-2.4.0.jar:2.4.0]
    at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:114) ~[spring-boot-2.4.0.jar:2.4.0]
    at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:106) ~[spring-boot-2.4.0.jar:2.4.0]
    at org.springframework.boot.context.config.ConfigDataImporter.resolve(ConfigDataImporter.java:101) ~[spring-boot-2.4.0.jar:2.4.0]
    at org.springframework.boot.context.config.ConfigDataImporter.resolve(ConfigDataImporter.java:93) ~[spring-boot-2.4.0.jar:2.4.0]


Caused by: java.lang.IllegalStateException: File extension is not known to any PropertySourceLoader. If the location is meant to reference a directory, it must end in '/'
    at org.springframework.boot.context.config.StandardConfigDataLocationResolver.getReferencesForFile(StandardConfigDataLocationResolver.java:199) ~[spring-boot-2.4.0.jar:2.4.0]
    at org.springframework.boot.context.config.StandardConfigDataLocationResolver.getReferences(StandardConfigDataLocationResolver.java:121) ~[spring-boot-2.4.0.jar:2.4.0]
    ... 30 common frames omitted

What is the issue please?请问是什么问题?

Thank you谢谢

This is actually an known error for the combination SpringBoot 2.4.0 + Ilford 2020.0.0-M3.这实际上是 SpringBoot 2.4.0 + Ilford 2020.0.0-M3 组合的已知错误。

In order to fix this particular problem, SpringBoot 2.4.0 needs Ilford 2020.0.0-M5.为了解决这个特殊问题,SpringBoot 2.4.0 需要 Ilford 2020.0.0-M5。

Upgrading to M5 from M3 will fix the issue.从 M3 升级到 M5 将解决此问题。

Thank you谢谢

Before doing anything first simply check if your dependency is added correctly because I also got this error & it was simply the dependency issue.在做任何事情之前,首先简单地检查您的依赖项是否正确添加,因为我也遇到了这个错误,这只是依赖项问题。

For gradle :对于gradle

implementation 'org.springframework.cloud:spring-cloud-starter-config'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Springboot 2.4.0-RC1 和 Spring Cloud Config (Illford) - java.lang.VerifyError: 不能从最终类继承 - Springboot 2.4.0-RC1 and Spring Cloud Config (Illford) - java.lang.VerifyError: Cannot inherit from final class 无法从 kubernetes 中的已安装卷将配置数据加载到 springboot 应用程序 - Unable to load config data to springboot application from mounted volume in kubernetes 在端口上带有事件记录器的应用程序:8080 在 SpringBoot 中监听来自 API 端口:8090 的调用 - App with Event logger on port:8080 listening calls from API port:8090 in SpringBoot 无法从 eclipse springboot 应用程序访问 localhost:8080 - Unable to access localhost:8080 from eclipse springboot application 无法将数据从 React 发送到 Springboot - Unable to send data from React to Springboot SpringBoot WebService Client Unable to load data security for user ANONYMOUS Exception - SpringBoot WebService Client Unable to load data security for user ANONYMOUS Exception Brixton Eureka / ConfigServer与Eureka / Config Angel客户兼容? - Brixton Eureka / ConfigServer compatibility with Eureka/Config Angel clients? 云配置出现请求执行错误。 endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/} 来自 Eureka 服务器 - Cloud config got Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/} from Eureka server 迁移 Feign 负载均衡器实现以兼容 Spring 云 2020.0.0 - Migrate Feign Load Balancer implementation to compatible with Spring cloud 2020.0.0 从HTTP网页加载自定义数据 - Load custom data from HTTP web page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM