BeanNotOfRequiredTypeException when using spring bean injection
- Dominant language
- Java
- Stars
- 41.6k
- Forks
- 26.4k
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 4
Description
- Dubbo version: 3.2.2
- Java version: 1.8
- SpringBoot: 2.7.13
[前面也讨论过这个问题](https://github.com/apache/dubbo/issues/10443)
3.X ReferenceAnnotationBeanPostProcessor 按@DubboReference属性名注册别名


这样会导致在不同的类中注入不同类型的Bean时必须要用不同的属性名称,如果像下面这样就会导致异常



**dubbo2.x 就没有这个问题,3.0中使用属性名注册别名是有什么特殊的用意吗?**
我理解这与spring并没有关系 https://github.com/apache/dubbo/issues/10443#issuecomment-1212703407,
因为我只要不用 dubbo3.x 就不会导致异常。
@chickenlj
Contributor guide
Research direction
Start by reviewing issue #10443 and the reproduction details and screenshots here, then compare the reported Dubbo 2.x and 3.x bean-injection behavior under Java 8 and Spring Boot 2.7.13. Done means injecting different bean types with the same property name no longer raises BeanNotOfRequiredTypeException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100