欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-03-21 23:27:58
Spring Cloud Config报错异常异性如下:  Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception isjava.lang.IllegalStateException: Cannot load environment] with root cause在Spring Cl...

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
特别注意:
  上面红色的配置是正确的蓝色是错误的,个人写代码时候不仔细造成错误 如果你也遇见了此问题希望可以帮到你。

  这样获取配置信息就可以正常查看啦:
nested exception is java.lang.IllegalStateException: Cannot load environment] with root cause

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