AnnotationConfigWebApplicationContext
should propagate ApplicationStartup
to BeanFactory
#32747
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Affects: 5.3.x, 6.0.x, 6.1.x, 6.2.x
When setting
ApplicationStartup
onAnnotationConfigWebApplicationContext
(or to be precise anyAbstractApplicationContext
that isn't alsoGenericApplicationContext
) it's not getting propagated toBeanFactory
after it was created:and as a result no bean events are recorded.
It's also not possible to set
applicationStartup
on the bean factory because it's not created yet, so that results inAs a workaround we can extend the
AnnotationConfigWebApplicationContext
and either overridecreateBeanFactory
or override
customizeBeanFactory
that already propagates other context settings to theBeanFactory
I think that should be done by default from the framework.
P.S. it doesn't reproduce with spring-boot because it uses different (similar?) context -
AnnotationConfigServletWebApplicationContext
The text was updated successfully, but these errors were encountered: