-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
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:
- Ordered interface not respected on non-singleton aspects [SPR-14959] #19526 Ordered interface not respected on non-singleton aspects
- SchedulingConfigurer's ScheduledTaskRegistrar should reliably shut down before TaskScheduler [SPR-15067] #19633 SchedulingConfigurer's ScheduledTaskRegistrar should reliably shut down before TaskScheduler
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement