I am trying to create a simple Spring Cloud Config server backend by GitHub Repository (public). The same configuration is working for Spring Boot 2.3.7 but not for Spring Boot 2.4.2.
java -version openjdk version "1.8.0_242" OpenJDK Runtime Environment (Zulu 8.44.0.11-win64)-Microsoft-Azure-restricted (build 1.8.0_242-b20) OpenJDK 64-Bit Server VM (Zulu 8.44.0.11-win64)-Microsoft-Azure-restricted (build 25.242-b20, mixed mode)
Repro steps:
- Create a Spring Boot project with Config Server dependency
- Add the following to application.properties:
spring.application.name=config-server-server23 server.port=8888 spring.cloud.config.server.git.uri=https://github.com/gkgaurav31/config.git
Adding @EnableConfigServer annotation.
Output from Config Server when accessing: http://localhost:8888/default/env
With Spring Boot 2.3.8:
{"name":"default","profiles":["env"],"label":null,"version":"85c8f673c450ee944ad612a1371b17e570785a7b","state":null,"propertySources":[{"name":"https://github.com/gkgaurav31/config.git/application.properties","source":{"application.message":"Hello, from default!","message":"Hello from GitHub!"}}]}
With Spring Boot 2.4.2:
{"name":"default","profiles":["env"],"label":null,"version":"85c8f673c450ee944ad612a1371b17e570785a7b","state":null,"propertySources":[]}
1) Is there any other configuration required for Spring Boot 2.4.x 2) How can we determine what is wrong?
Comment From: spencergibb
https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes#breaking-changes
Either use the new way of importing spring.config.import=configserver: in application.yml (not bootstrap) or add spring-cloud-starter-bootstrap.
Comment From: Mohammadpiran
https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes#breaking-changes
Either use the new way of importing
spring.config.import=configserver:in application.yml (not bootstrap) or addspring-cloud-starter-bootstrap.
I am new in spring boot. Ihave same problem. Can you explain more. Tnx
Comment From: MohammadTofic-prog
I have the same issue , the problem in config server not in the client , so i do not think the previous answers will solve it , please we need help
Comment From: Mohammadpiran
I use spring version 2.4.2.snapshot and my problem solved. I think there is problem in version of spring boot.
Comment From: Mohammadpiran
Config property source is empty. When i run config server in linux ubuntu my problem solved. I dont know what can be the problem reason.
Comment From: bberus
I think root cause of issue is described here (by me): https://stackoverflow.com/questions/65371728/springboot-config-server-file-separator-issue
Comment From: spencergibb
Closing, those on windows follow #1774