Spring cloud config server APPLICATION FAILED TO START when use Open JDK 11

Viewed 2603

I am trying to use Spring cloud config server in my project. I am using openJdk 11.

I am not using git URI. I have used few yml files which are located under resources config folder

I am getting below error

***************************
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.


Process finished with exit code 1
3 Answers

If you are using Spring Cloud Config Server feature you need to provide proper configuration for service to start. Default profile is git, you need to provide URI to the repository which contains configuration.

From reference doc:

Spring Cloud Config Server pulls configuration for remote clients from a git repository (which must be provided), as shown in the following example:

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/spring-cloud-samples/config-repo

See more at: https://cloud.spring.io/spring-cloud-static/spring-cloud-config/2.0.2.RELEASE/single/spring-cloud-config.html#_quick_start

Try below application.property file of config server

server.port = 8888

spring.cloud.config.server.native.search-locations=file:///C:/configprop/

spring.profiles.active=native

you need configure your applicarion.yml as below:

server:
  port: 8888
spring:
  cloud:
    config:
      server:
        composite:
          - type: native
            search-locations: classpath:/shared
  security:
    user:
      password: 'your-any-password'
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka

and your configs of other apps lied in resources/shared folder

Related