Hello all. I've a small project with Spring Boot 2.4.0
plugins {
id 'org.springframework.boot' version '2.4.0'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
}
And Spring Cloud Config Client 2.2.5.RELEASE
ext {
set('springCloudVersion', "Hoxton.SR9")
springCloudConfigClientVersion = "2.2.5.RELEASE"
}
dependencies {
...
compile "org.springframework.cloud:spring-cloud-config-client:$springCloudConfigClientVersion"
...
}
However, the application cannot read my bootstrap.properties file
spring.application.name= oauth-service spring.cloud.config.uri= http://localhost:8888
Whenever I try to access those properties (or any property in that file) I get a NullPointerException.
But if I downgrade to Spring Boot 2.3.5
plugins {
id 'org.springframework.boot' version '2.3.5.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
}
Everything works fine.
Is this a known issue? Is there anything I have to do (any additional configuration) when working with Spring Boot 2.4.0 and Spring Cloud Config Client?
Comment From: mbhave
@lucasdistasi Spring Boot 2.4 is compatible with the 2020.0.0 (aka Ilford) release train of Spring Cloud. The Spring Cloud team just released the 5th milestone for that. Spring Cloud Hoxton is compatible with Spring Boot 2.3.x and Spring Boot 2.2.x. You can find the table for Spring Cloud and Spring Boot compatibility here.
Comment From: cellmobs
This should be reopened. The config client is not connecting to the Config Server. 2.4.0 and 2020.0.0-M5. It works fine with 2.3.6. and Hoxton.SR9.
Comment From: lucasdistasi
This should be reopened. The config client is not connecting to the Config Server. 2.4.0 and 2020.0.0-M5. It works fine with 2.3.6. and Hoxton.SR9.
Yes. I had to rollback the versions on my project because is not working with the new ones.
Comment From: spencergibb
It's not a spring boot issue. Spring Cloud has made breaking changes. See the release notes https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes#breaking-changes
Comment From: mrksph
So?? I just migrated my code from Spring Boot 2.3.6 to 2.4.0. After deploying to my DEV environment I don't see my Spring Boot app pulling its config from Spring Cloud (Spring Cloud 2020.0.0-M5)
Comment From: scottfrederick
Spring Cloud 2020.0.0-M6 has been released, with improved compatibility with Spring Boot 2.4.0. If there are further issues with this combination of Spring Boot and Spring Cloud Config, please open an issue in the Spring Cloud Config project.
Comment From: mrksph
Is it proven it works? As it is a recent release there aren't much on internet... If not I will have to revert the migration..
Comment From: jingyangpeng
According to Spring Cloud 2020.0 Release Notes:
Bootstrap, provided by spring-cloud-commons, is no longer enabled by default. If your project requires it, it can be re-enabled by properties or by a new starter.
To re-enable by properties set spring.cloud.bootstrap.enabled=true or spring.config.use-legacy-processing=true. These need to be set as an environment variable, java system property or a command line argument. The other option is to include the new spring-cloud-starter-bootstrap.
add spring-cloud-starter-bootstrap
to my Project Works fine.
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
Comment From: busches
It's not a spring boot issue. Spring Cloud has made breaking changes. See the release notes spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes#breaking-changes
@spencergibb Shouldn't this be listed in the upgrade/release notes? https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.4-Release-Notes There's no mention of Spring Cloud changes on the page.
I'd expect it at least called out here:
Comment From: spencergibb
Spring Boot doesn't manage Spring Cloud dependencies, so no it shouldn't be listed there.
Comment From: busches
@spencergibb but Spring Boot is not backwards compatible with older Spring Cloud Versions, so something changed right? How can we make this more obvious for people upgrading in the future?
Comment From: snicoll
@busches you're taking that dependency upside down. Spring Cloud uses Spring Boot, not the other way around. If you are using Spring Cloud, please check first that the Spring Cloud version you are using is compatible with the Spring Boot version you intend to upgrade to. There isn't anything we can do in this issue tracker for this.