-
Couldn't load subscription status.
- Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Piotr Findeisen opened SPR-13526 and commented
steps to reproduce
- Use
<context:annotation-config />- this loads
EventListenerMethodProcessor
- this loads
- have a prototype bean "
A" which uses@Transactionaland expects constructor arguments to be provided usingorg.springframework.beans.factory.BeanFactory.getBean(String, Object...)- the bean doesn't need to use
@EventListener
- the bean doesn't need to use
- start the context
expected
- context starts
- if "
A" is the only bean (or if nothing uses "A"), the bean is not instantiated at all
observed
EventListenerMethodProcessorwants to know whether "A" is annotated with@EventListener- it calls
applicationContext.getType("A")applicationContext(or ratherInfrastructureAdvisorAutoProxyCreator) sees@Transactional...- ... so sth like
A$$EnhancerBySpringCGLIB$$8e7e447is returned
EventListenerMethodProcessor.getTargetClasssees the bean class is kind ofSpringProxy, so...- it instantiates the bean, but obviously not providing required arguments to constructor
- it calls
Affects: 4.2.1
Issue Links:
- EventListener in a Request scoped bean fails context initialization [SPR-13681] #18256 EventListener in a Request scoped bean fails context initialization
- Spring incorrectly interprets a bean to be a spring eventlistener [SPR-13538] #18114 Spring incorrectly interprets a bean to be a spring eventlistener
- EventListenerMethodProcessor resolves classes of lazy beans causing NoClassDefFoundError [SPR-13712] #17619 EventListenerMethodProcessor resolves classes of lazy beans causing NoClassDefFoundError
Referenced from: commits dbec212
1 votes, 5 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug