This is an automated email from the ASF dual-hosted git repository.
crazyhzm pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 7081b5d 修复Consumer启动时报空指针异常的问题 (#8080)
7081b5d is described below
commit 7081b5d48185b045d5d548f21fe9faa0397e425d
Author: klzami <[email protected]>
AuthorDate: Thu Jun 17 10:27:18 2021 +0800
修复Consumer启动时报空指针异常的问题 (#8080)
修复Consumer启动时报空指针异常的问题,相关issue:https://github.com/apache/dubbo/issues/8078
---
.../beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java
b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java
index 2cb397f..2f4166f 100644
---
a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java
+++
b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java
@@ -162,6 +162,9 @@ public class ReferenceAnnotationBeanPostProcessor extends
AbstractAnnotationBean
private boolean isAnnotatedReferenceBean(BeanDefinition beanDefinition) {
if (beanDefinition instanceof AnnotatedBeanDefinition) {
AnnotatedBeanDefinition annotatedBeanDefinition =
(AnnotatedBeanDefinition) beanDefinition;
+ if (annotatedBeanDefinition.getFactoryMethodMetadata() == null) {
+ return false;
+ }
String beanClassName =
annotatedBeanDefinition.getFactoryMethodMetadata().getReturnTypeName();
if (ReferenceBean.class.getName().equals(beanClassName)) {
return true;