Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
dubbo-dubbo-3.2.9 open jdk 8
Steps to reproduce this issue
https://github.com/apache/dubbo/tree/dubbo-3.2.9
What you expected to happen
When Dubbo is used in conjunction with the Spring container, if the Dubbo generic invocation mode is used and the bean is created using the @bean annotation, it can result in the consumer not being registered as a Spring bean.
For example, when registering a consumer using Dubbo's generic invocation mode, if the @bean annotation is used to create this bean, it can result in the consumer not being registered as a Spring bean.
The reference.get() method returns a proxy object, and the tClass of this proxy object is 'com.xxx.XxxService'.
The reference.get() method returns a proxy object, and the tClass of this proxy object is 'com.xxx.XxxService'. Additionally, this bean is injected using @Autowired and @qualifier as follows:
@Autowired
@qualifier("XxxService")
private GenericService xxxService;
The code for generating a proxy object by Dubbo is as follows: If com.xxx.XxxService exists in the current code package, but reference.setGeneric(true); is still set, it will cause the actual object of the proxy to be com.xxx.XxxService instead of org.apache.dubbo.rpc.service.GenericService.
spring start error text e.g :
Unsatisfied dependency expressed through field 'membershipUserTagTestService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'membershipUserTagTestServiceImpl': Unsatisfied dependency expressed through field 'aeMarketingStrategyShowFacadeGeneric'; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'aeMarketingStrategyShowFacadeGeneric' is expected to be of type 'org.apache.dubbo.rpc.service.GenericService' but was actually of type 'com.sun.proxy.$Proxy524'
Anything else
No response
Do you have a (mini) reproduction demo?
Are you willing to submit a pull request to fix on your own?
Code of Conduct