Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
249 views
in Technique[技术] by (71.8m points)

java - Config server native profile issue after spring cloud upgrade to 2020.0.0

I have upgraded the spring cloud version from Hoxton.SR9 to 2020.0.0 (spring boot version 2.4.0 onwards).

I am using native profile to read configurations from the resource folder.

spring:
  application:
    name: config-server
  profiles:
    active: native

  cloud:
    config:
      server:
        native:
          search-locations: classpath:/config/form-service, classpath:/config/tpm-admin-service, classpath:/config/tpm-service, classpath:/config/tpm-api-gateway-admin, classpath:/config/tpm-api-gateway-app, classpath:/config/sdc-service, classpath:/config/sdc-api-gateway-app, classpath:/config/sdc-admin-service, classpath:/config/sdc-api-gateway-admin, classpath:/config/attachment-service, classpath:/config/fds-service, classpath:/config/fds-admin-service, classpath:/config/fds-api-gateway-admin, classpath:/config/fds-api-gateway-app, classpath:/config/onboarding-service

server:
  port: ${config_server_port:8888}

After the upgrade, the config-server startup is giving the following error:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-01-27 18:02:58.523 ERROR 4552 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Invalid config server configuration.

Action:

If you are using the git profile, you need to set a Git URI in your configuration.  If you are using a native profile and have spring.cloud.config.server.bootstrap=true, you need to use a composite configuration.

I have tried using composite profile as well (shown below) but nothing seems to work.

spring:
  application:
    name: config-server
  profiles:
    active: composite

  cloud:
    config:
      server:
        composite:
        - type: native
          search-locations: classpath:/config/form-service, classpath:/config/tpm-admin-service, classpath:/config/tpm-service, classpath:/config/tpm-api-gateway-admin, classpath:/config/tpm-api-gateway-app, classpath:/config/sdc-service, classpath:/config/sdc-api-gateway-app, classpath:/config/sdc-admin-service, classpath:/config/sdc-api-gateway-admin, classpath:/config/attachment-service, classpath:/config/fds-service, classpath:/config/fds-admin-service, classpath:/config/fds-api-gateway-admin, classpath:/config/fds-api-gateway-app, classpath:/config/onboarding-service
        bootstrap: true

server:
  port: ${config_server_port:8888}

PS. Facing a similar issue with the project downloaded using spring initializer.

question from:https://stackoverflow.com/questions/65919516/config-server-native-profile-issue-after-spring-cloud-upgrade-to-2020-0-0

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...