Skip to content

ScheduledAnnotationBeanPostProcessor should reliably apply after AnnotationAwareAspectJAutoProxyCreator [SPR-14692] #19256

Closed
@spring-projects-issues

Description

@spring-projects-issues

Mischa Neumann opened SPR-14692 and commented

if you use @EnableAspectJAutoProxy and e.g. @EnableScheduling you might accidentally create a ScheduledMethodRunnable with an unproxied bean.

this is caused by AnnotationAwareAspectJAutoProxyCreator and ScheduledAnnotationBeanPostProcessor both having a default order of Ordered.LOWEST_PRECEDENCE.

as the developer usually has no insight in which post processor is applied in which order and the ordering might be critical for the application to function properly, I would suggest:

  • log all post processors and their ordering at INFO level on startup
  • force all post processors to have a unique order (there is enough space between Ordered.LOWEST_PRECEDENCE and HIGHEST_PRECEDENCE)
  • review the existing spring framework post processors for having a reasonable default order

Affects: 4.2.7

Issue Links:

Referenced from: commits fd21e0e, edc62be

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions