diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java index 92de553740..f9d1ae61a6 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java @@ -584,7 +584,10 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto if (bd instanceof AbstractBeanDefinition) { AbstractBeanDefinition abd = (AbstractBeanDefinition) bd; if (abd.hasBeanClass()) { - ann = AnnotationUtils.findAnnotation(abd.getBeanClass(), annotationType); + Class beanClass = abd.getBeanClass(); + if (beanClass != beanType) { + ann = AnnotationUtils.findAnnotation(beanClass, annotationType); + } } } }