【问题标题】:In Ejb Session bean can we extend another session bean在 Ejb 会话 bean 中我们可以扩展另一个会话 bean
【发布时间】:2014-10-13 11:10:55
【问题描述】:

程序:

@Local
interface AInter{
//...
}
class A implements AInter{
//...
}
@Local
interface BInter extends AInter{
//...
}
class B implements BInter {
//...
}
In Backing:
@Inject
BInter binter; //It's work fine
But If i tried 
@Inject
AInter aInter; //But if i try to access A interface from my backing.

它显示这样的警告

Multiple beans are eligible for injection to the injection point JSR-299 5.2.1

拜托,谁能解释清楚我被困在这里。如果我以后继续这样下去,就会有任何问题。

谢谢。

【问题讨论】:

    标签: java jakarta-ee ejb


    【解决方案1】:

    您正在尝试注入 AInter bean 的实例,但 CDI 容器不知道要注入哪个实现。你应该使用注解qualifier给他一个提示,或者使用替代方法等。

    【讨论】:

    • 谢谢Ajan。你的回答很有帮助
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多