You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ScheduledAnnotationBeanPostProcessor does not support Duration syntax [SPR-15455] #20016
The ScheduledAnnotationBeanPostProcessor component is not able to parse and support the duration syntax. (PT20S).
In order to support this, one may have to configure a StringValueResolver on ScheduledAnnotationBeanPostProcessor but there is no clear path to how that might be injected into ScheduledAnnotationBeanPostProcessor. Given how SchedulingConfiguration creates the ScheduledAnnotationBeanPostProcessor bean, it seems like the StringValueResolver instance is always hardcoded.
Received error is:
Initialization of bean failed; nested exception is java.lang.IllegalStateException: Encountered invalid @Scheduled method 'run': Invalid initialDelayString value "PT10S" - cannot parse into integer>
This makes sense in the context of Spring Framework 5.0 in particular where we provide deeper integration with Java 8 across the framework. ScheduledAnnotationBeanPostProcessor leniently accepts number values as well as java.time.Duration compliant specifications now.
Activity
spring-projects-issues commentedon Jan 25, 2018
Juergen Hoeller commented
This makes sense in the context of Spring Framework 5.0 in particular where we provide deeper integration with Java 8 across the framework.
ScheduledAnnotationBeanPostProcessorleniently accepts number values as well asjava.time.Durationcompliant specifications now.