Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. spring-projects-issues commented on Jan 25, 2018

    @spring-projects-issues
    CollaboratorAuthor

    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.

  2. added
    type: enhancement
    in: core
    on Jan 11, 2019
  3. added this to the 5.0.4 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coretype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions