Skip to content

BeanNotOfRequiredTypeException when using spring bean injection #12637

@c-der

Description

@c-der
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/sdkRelated with apache/dubbogood first issueGood for starters to contributehelp wantedEverything needs help from contributorstype/enhancementEverything related with code enhancement or performance

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions