DefaultListableBeanFactory.getBean(Class) throws NoSuchBeanDefinitionException on existing bean if getBean(Class) previously tried before registration #24852
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: spring-context:5.2.5.RELEASE
I register a new
BeanDefinition
viacontext.registerBeanDefinition
, but I still haveNoSuchBeanDefinitionException
oncontext.getBean
becausecontext.getBean
cached my previous call before bean registration.Only if I call
context.getBeanFactory().clearMetadataCache()
manually this code doesn't throw any exception, but now it does.I think unsuccessful resolved bean shouldn't be cached in
getBeanNamesForType
.The text was updated successfully, but these errors were encountered: