nested exception is java.lang.IllegalStateException: Cannot load environment] with root cause

2022-07-25,,,,

Spring Cloud Config报错异常异性如下:

  Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Cannot load environment] with root cause

在Spring Cloud Config项目当中的application.properties配置文件相关信息:

#内嵌tomcat
server.port=3721
#服务名称
spring.application.name=07springcloudconfigserver

spring.cloud.config.server.git.uri=https://github.com/nanxiaojiang/spring-cloud-config.git
spring.cloud.config.server.git.search-paths=config-center
spring.cloud.config.label=master
spring.cloud.config.server.git.username=username

spring.cloud.config.server.git.password=password
spring.cloud.config.server.git.passphrase=password
特别注意:
  上面红色的配置是正确的蓝色是错误的,个人写代码时候不仔细造成错误 如果你也遇见了此问题希望可以帮到你。

  这样获取配置信息就可以正常查看啦:

本文地址:https://blog.csdn.net/nan1996jiang/article/details/112576688

《nested exception is java.lang.IllegalStateException: Cannot load environment] with root cause.doc》

下载本文的Word格式文档,以方便收藏与打印。