spring cloud config java.lang.IllegalStateException: Could not locate PropertySource and the fail fa

异常信息

spring cloud config java.lang.IllegalStateException: Could not locate PropertySource and the fail fa_第1张图片

错误原因

1、config server 中 default-label 与git或SVN分支对应不上
2、config client 中 label 与git或SVN分支对应不上

解决方法

1、在git 或SVN上创建对接分支

2、config server和config client 配置git或svn对应分支

配置方式如下:
- config server default-label 替换成Git或SVN已有分支

spring:
  application:
    name: herion-config-server
  profiles:
    active: dev
  cloud:
    config:
      server:
        git:
          uri:  https://xxxx/herion/jfintech-config.git
          default-label: ${spring.profiles.active} 

spring cloud config java.lang.IllegalStateException: Could not locate PropertySource and the fail fa_第2张图片

  • config client label 替换成Git或SVN已有分支
 spring:
  application:
    name: herion-confit-client
  profiles:
    active: dev
  cloud:
    config:
      fail-fast: true
      discovery:
        service-id: herion-config-server
        enabled: true
      profile: ${spring.profiles.active}
      label: ${spring.profiles.active}

spring cloud config java.lang.IllegalStateException: Could not locate PropertySource and the fail fa_第3张图片

你可能感兴趣的:(spring,cloud,异常解决)