I\'m using Spring Boot and have two very similar services which I\'d like to configure in my application.yml.
The configuration looks roughly like this:
Javvanos example worked perfektly, except for JavaBean Validation.
I've had an annotation @NotNull on one of the properties:
public class ServiceProperties {
@NotNull
private String url;
private String port;
// Getters & Setters
}
As a consequence, the application startup failed with following error message:
***************************
APPLICATION FAILED TO START
***************************
Description:
Binding to target ch.sbb.hop.commons.infrastructure.hadoop.spark.SparkJobDeployerConfig@730d2164 failed:
Property: url
Value: null
Reason: may not be null
Action:
Update your application's configuration
After removing the annotation, the application startet up with correct property binding. In conclusion, I think there is an issue with JavaBean Validation not getting the correctly initialized instance, maybe because of missing proxy on configuration methods.