DaleShay opened a new issue, #10443:
URL: https://github.com/apache/dubbo/issues/10443

   <!-- If you need to report a security issue please visit 
https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) 
of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.0.10
   * Operating System version: Mac 11.6 
   * Java version: 1.8.0_221
   
   ### Steps to reproduce this issue
   
   1. 
    DemoService 有 DemoServiceImpl 实现 是 @DubboService ,
    TestService  由 TestServiceImpl 实现   是普通的 @Service
   <img width="1014" alt="image" 
src="https://user-images.githubusercontent.com/39309978/184127210-bec9732c-f818-4105-b735-c1edec561c45.png";>
   <img width="629" alt="image" 
src="https://user-images.githubusercontent.com/39309978/184127276-ce6b57a6-8d86-4926-bbc7-1a6e3bc3762e.png";>
   
   
   2. 
   并在两个不同的地方 用@DubboReference  和 @Resource 引用 ,用相同的beanName 都写为 testService
   <img width="688" alt="image" 
src="https://user-images.githubusercontent.com/39309978/184126626-7da38dcb-8325-4fa6-ae9e-583af8d4093c.png";>
   
   <img width="788" alt="image" 
src="https://user-images.githubusercontent.com/39309978/184126538-81ee5d82-e196-4c76-9e84-3df914f58676.png";>
   
   
   
   ### Actual Behavior
   3. 启动后报错
   
   Description:
   
   The bean 'testService' could not be injected as a 
'org.apache.dubbo.springboot.demo.consumer.TestService' because it is a JDK 
dynamic proxy that implements:
   
   
   Action:
   
   Consider injecting the bean as one of its interfaces or forcing the use of 
CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or 
@EnableCaching.
   
   4. 如果 TestService 不是 由 TestServiceImpl 实现 的接口,而是直接是 @Service 类 则不报错
   <img width="1272" alt="image" 
src="https://user-images.githubusercontent.com/39309978/184128452-6b5d989a-d9db-4346-90a7-9384d96d3d47.png";>
   
   
   6. 如果 TestService 的实现 是  @DubboService  且引用的地方是 @DubboReference 也不会报错
   <img width="1317" alt="image" 
src="https://user-images.githubusercontent.com/39309978/184128702-6333f48b-bf18-4e94-a30e-09fea3cf470e.png";>
   <img width="752" alt="image" 
src="https://user-images.githubusercontent.com/39309978/184128731-2ff88f9f-005d-4d4d-81b5-48ddfc42da21.png";>
   
   7.目测是 check bean definition  ReferenceAnnotationBeanPostProcessor 
   407 行 beanDefinitionRegistry.containsBeanDefinition(referenceBeanName)  
判断有一定的问题
   <img width="821" alt="image" 
src="https://user-images.githubusercontent.com/39309978/184129295-12cd34a6-1c2b-4bf8-9308-909d71691612.png";>
   
   
   8.目前只能命名规范,让它不相同 。
   
   If there is an exception, please attach the exception trace:
   
   ```
   Just put your stack trace here!
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to