apache/dubbo

BeanNotOfRequiredTypeException when using spring bean injection

Open

#12,637 opened on Jul 1, 2023

View on GitHub
 (12 comments) (0 reactions) (0 assignees)Java (41,524 stars) (26,453 forks)batch import
component/sdkgood first issuehelp wantedtype/enhancement

Description

  • Dubbo version: 3.2.2
  • Java version: 1.8
  • SpringBoot: 2.7.13

前面也讨论过这个问题

3.X ReferenceAnnotationBeanPostProcessor 按@DubboReference属性名注册别名 image image 这样会导致在不同的类中注入不同类型的Bean时必须要用不同的属性名称,如果像下面这样就会导致异常 image image image dubbo2.x 就没有这个问题,3.0中使用属性名注册别名是有什么特殊的用意吗? 我理解这与spring并没有关系 https://github.com/apache/dubbo/issues/10443#issuecomment-1212703407, 因为我只要不用 dubbo3.x 就不会导致异常。 @chickenlj

Contributor guide

BeanNotOfRequiredTypeException when using spring bean injection · apache/dubbo#12637 | Good First Issue