Ejb 引用另一个 ejb
我有两个EJB,EJB A引用EJB B,两者都部署到同一服务器。
每次我尝试部署 EJB A 时,它都会尝试注册已部署并注册的 EJB B,这会导致错误:
java.lang.IllegalStateException
知道如何阻止 EJB A 注册引用的 EJB 吗?
我正在使用 NetBeans 和 JBoss 4.2.3 以及 EJB 3.0。
I have two EJBs , EJB A references EJB B, both are deployed to the same server.
Each time I try to deploy EJB A it tries to register EJB B which is already deployed and registered which causes error:
java.lang.IllegalStateException
Any idea how to prevent EJB A from registering the referenced EJB?
I am using NetBeans and JBoss 4.2.3 as well as EJB 3.0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你使用maven构建
使用
您可以在EJB A的maven的pom文件中
If you use maven build
you can use
in the pom file of maven of EJB A
虽然我无法想象如果您的 EJB A 是单例,为什么会出现异常,请尝试注释 @DependsOn 指定对 B 的依赖。
Although I cannot imagine why you get an exception if your EJB A is singleton try the annotation @DependsOn on A to specify a dependency on B.