You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the 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.
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.
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 discussion was converted from issue #12800 on March 11, 2024 06:39.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
当你的接口只有一个实现类的时候,并且这个实现类被@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
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.
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
Beta Was this translation helpful? Give feedback.
All reactions