Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScheduledAnnotationBeanPostProcessor does not support Duration syntax [SPR-15455] #20016

Closed
spring-projects-issues opened this issue Apr 17, 2017 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 17, 2017

Misagh Moayyed opened SPR-15455 and commented

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>

Affects: 4.3.7

Issue Links:

Referenced from: commits 13c7354

@spring-projects-issues
Copy link
Collaborator Author

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. ScheduledAnnotationBeanPostProcessor leniently accepts number values as well as java.time.Duration compliant specifications now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants