Skip to content

@Scheduled methods in @Lazy beans are not scheduled [SPR-17587] #22119

Closed
@spring-projects-issues

Description

@spring-projects-issues

Silvio Assunção Junior opened SPR-17587 and commented

The issue #17470 was not resolved,  the problem continue

I checked the code of ScheduledAnnotationBeanPostProcessor and the tasks will registered on method postProcessAfterInitialization, but lazy Beans it is not created or initialized, than Beans with @Scheduled and @Lazy does not work correctly

The Schedule will be registered only if I will use the Bean (Force a creation)

Other guys with the same problem https://stackoverflow.com/questions/47585846/why-spring-schedule-do-not-work-with-lazy


Affects: 4.3.18

Reference URL: #17470

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions