EJB 实现外部库的接口
我有一个 java 类,它实现了外部库的接口。 我通过使用 @Stateless
注释将该 java 类转换为 EJB。 我将其转换为 EJB 的原因是为了利用依赖项注入并获取 EntityManager API 的句柄。但我无法将此无状态 bean 注入其他 EJB。
I have a java class which implements an interface from an external library.
I converted this java class into an EJB by anotating with @Stateless
.
The reason I converted this to an EJB is for leveraging the dependency injection and to get an handle for EntityManager
API. But I am not able to inject this Stateless bean into other EJBs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过使用
@Stateless
和@Local
来注释您的 EJB?它应该包含接口的名称作为值:@Local(MyBeanInterface.class)
Have you tried to annotate your EJB with
@Stateless
and@Local
too? It should contain the name of the interface as value:@Local(MyBeanInterface.class)