You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "xixingya (via GitHub)" <gi...@apache.org> on 2023/07/26 11:51:13 UTC
[GitHub] [dubbo] xixingya opened a new issue, #12800: dubbo spi IOC some case not work
xixingya opened a new issue, #12800:
URL: https://github.com/apache/dubbo/issues/12800
<!-- 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.
当你的接口只有一个实现类的时候,并且这个实现类被@Adaptive注解。那么你在另外一个类中,通过inject将无法注入成功这个类
When your interface has only one implementation class, and this implementation class is annotated with @Adaptive. Then you are in another class, you will not be able to successfully inject this class through inject
### Environment
* Dubbo version: latest
* Operating System version: mac os
* Java version: 1.8
### Steps to reproduce this issue
Pls. provide [GitHub address] to reproduce this issue.
### Expected Behavior
当你的接口只有一个实现类的时候,并且这个实现类被@Adaptive注解。那么你在另外一个类中,可以成功注入这个类。
When your interface has only one implementation class, and this implementation class is annotated with @Adaptive. Then you are in another class and can successfully inject this class.
<!-- What do you expect from the above steps?-->
### Actual Behavior
当你的接口只有一个实现类的时候,并且这个实现类被@Adaptive注解。那么你在另外一个类中,无法成功注入这个类。
When your interface has only one implementation class, and this implementation class is annotated with @Adaptive. Then you are in another class and cannot successfully inject this class.
具体可以看demo类中的main方法。当Log只有一个实现类的时候,并且这个实现类被注解,getLog是null。当log有两个实现类的时候,可以注入成功,比如说Log2这个接口,就可以注入成功。
For details, see the main method in the demo class. When Log has only one implementation class, and this implementation class is annotated, getLog is null. When the log has two implementation classes, it can be injected successfully. For example, the Log2 interface can be injected successfully.
请看:(please see)
https://github.com/xixingya/dubbo-demo
--
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: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] dubbo spi IOC some case not work [dubbo]
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ closed issue #12800: dubbo spi IOC some case not work
URL: https://github.com/apache/dubbo/issues/12800
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] xixingya commented on issue #12800: dubbo spi IOC some case not work
Posted by "xixingya (via GitHub)" <gi...@apache.org>.
xixingya commented on issue #12800:
URL: https://github.com/apache/dubbo/issues/12800#issuecomment-1651657218
https://github.com/apache/dubbo/pull/12792
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org