从另一个 Glassfish(Web-Container)访问另一个 Glassfish(EJB-Container)中运行的远程 EJB
我想使用两台独立的服务器,一台用于 Web 容器,一台用于 ejb 容器。 这两个容器都是 Glassfish V3。
但是,如何在我的 Web 项目中使用 @EJB 注释来访问远程 ejb-container 的 ejb。
在 Ejb 2.0 中,我们必须使用 ejb-descriptors,但是 Ejb3.0 和 glassfish v3 中发生了什么?
谢谢
I want to use two separate servers, one for web-container and one for ejb-container.
The both of these two containers are Glassfish V3.
But, How to use @EJB annotation in my web project to access to remote ejb-container's ejb(s).
In Ejb 2.0 we have to use ejb-descriptors but what happened in Ejb3.0 and glassfish v3?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我个人从未这样做过,因为我更喜欢在同一个 JVM 中使用本地接口,因为它可以显着提高性能。
但您可以查看一下:
https://glassfish.dev.java。 net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB
但您可以尝试一下:
步骤 2. 在查找中使用目标远程 EJB 的全局 JNDI 名称。
EJB 3.x,假设全局 JNDI 名称为“com.acme.FooRemoteBusiness”:
EJB 2.x,假设全局 JNDI 名称为“com.acme.FooHome”:
I've never personally done that because I prefer using local interfaces within the same JVM as it improves performance dramatically.
But you can check this out:
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB
But you can give this a try:
Step 2. Use the global JNDI name of the target Remote EJB in the lookup.
EJB 3.x, assuming a global JNDI name of "com.acme.FooRemoteBusiness" :
EJB 2.x, assuming a global JNDI name of "com.acme.FooHome" :