spring-cloud-starter-config causes config bean validation to fail
See original GitHub issueSpring boot 1.5.2 fails to start because of bean validation errors caused by spring-cloud-config-starter:Camden.SR5
.
We have a couple of @ConfigurationProperties
in our project - some of properties to be set are coming from a defaults.properties
in the classpath and others are overwritten by a config provided by a config server. Since we upgraded to boot:1.5.2
and spring-cloud:Camden.SR5
our app does not start properly anymore because of a bean validation error like the following:
Binding to target com.example.config.MiscConfigInfo@6f6962ba failed:
Property: misc.kmsToWarning
Value: null
Reason: may not be empty
Property: misc.listener
Value: null
Reason: may not be null
Action:
Update your application's configuration
So far so good, the description seems very clear, but it actually is wrong - the configuration is all fine and it works as soon as we remove spring-cloud-config-starter
from the classpath.
Here is a very small project demonstrating the issue: https://github.com/imod/spring-config-validation-issue
For now, there only seems one workaround: we have to disable the field validation (remove the annotations on the properties).
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
It’s fixed in snapshots (Camden and Dalston). New releases are coming shortly. Probably this change: https://github.com/spring-cloud/spring-cloud-commons/commit/8347c5741c3100a5f941db32f43f5088bb54bad5
done: #663