public class Properties {
@Value("${scheduler.cron:0 0/15 * * * *")
private String schedulerCron;
public Properties() {
//schedulerCron = "0 0/15 * * * *";
}
}
If I do not use @Value
and populate the property as I have in constructor, I am able to use it. But I am not able to inject it via @Value
. It does not like the expression and gives below error
Encountered invalid @Scheduled method 'scheduler': For input string: "${scheduler.cron:0" '${scheduler.cron:0' in cron expression "${scheduler.cron:0 0/15 * * * *"