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-issuemaster opened this issue Apr 17, 2017 · 1 comment
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster 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:

  • #20736 StringToLocaleConverter should allow BCP 47 values
  • #19405 @DateTimeFormat support for YearMonth, MonthDay, Year

Referenced from: commits 13c7354

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented 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. 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.