如何解决模棱两可的依赖性?
我对我的小组项目有模棱两可的依赖性。我不想透露代码,因为我不确定是否可以显示它。这就是为什么我想给出问题的抽象形式:
@ShiroSecured
@RequiresRoles({Role.ADMIN})
@Named
@RequestScoped
public class A{
@Inject
protected AbstractBean abstractBean; <-- Intellij shows me here 'Ambiguous dependency'
}
@Named
@ViewScoped
public class B extends A implements Serializable {
}
@Named
@ViewScoped
public class C extends A implements Serializable {
}
我有点理解问题是什么,但是我不知道如何解决问题。我进行了研究,并且有删除beans.xml
或使用预选赛的东西?
I have a ambiguous dependency in my group project. I don't want to reveal the code, because I'm not sure if I'm allowed to show it. That's why I want to give a abstract form where the problem is:
@ShiroSecured
@RequiresRoles({Role.ADMIN})
@Named
@RequestScoped
public class A{
@Inject
protected AbstractBean abstractBean; <-- Intellij shows me here 'Ambiguous dependency'
}
@Named
@ViewScoped
public class B extends A implements Serializable {
}
@Named
@ViewScoped
public class C extends A implements Serializable {
}
I kind of understand what the problem is, but I don't know how to fix it. I researched and there was something with deleting a beans.xml
or using qualifiers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论