EJB远程应用程序客户端 [英] EJB remote application-client
问题描述
我正在开始一个新的企业项目,并将 Glassfish 3
作为应用程序服务器,将 NetBeans 6.9
code> IDE 。我有一些 EJBs
,我想从桌面 Swing
应用程序远程访问。 AFAIK有两个选项 - 使用简单的 JNDI
查找或在应用程序客户端容器中运行 Swing
应用程序,并使用 @EJB
注释。我尝试成功的第一个选项,但我不得不复制所有的 glassfish
库以满足依赖(约50MB,我找不到正常的)。现在我尝试第二个选项。在 NetBeans
中,我创建一个新的企业应用程序客户端
项目,将EJB项目添加为依赖关系并按运行。我得到以下异常:类型为[ejb]和类型为[appclient]的嗅探器不应该同时声明存档
。现在如果我删除应用程序客户端的Project属性中的EJB项目旁边的包
复选框,我得到一个不同的 ClassNotFound
我的远程接口的例外。
I am starting a new enterprise project and use Glassfish 3
as an application server and NetBeans 6.9
as an IDE
. I have some EJBs
which I want to access remotely from a desktop Swing
application. AFAIK there are two options - either use plain JNDI
lookup or run the Swing
application in an application-client container and use @EJB
annotations. I tried successfully the first option but I had to copy all glassfish
libraries to satisfy the dependencies(about 50MB, which I don't find normal). Now I try the second option. In NetBeans
, I create a new Enterprise Application Client
project, add the EJB project as a dependency and press run. I get the following exception: Sniffers with type [ejb] and type [appclient] should not claim the archive at the same time
. Now if I remove the package
checkbox, next to the EJB project in the Project properties of application client, I get a different ClassNotFound
exception of my remote interface.
我觉得有些卡住了:(可能有些更有经验的人,告诉我如何远程访问他们的EJB,使用 Glassfish 3
?如上所述,我成功使用了第一个选项,但对于一个简单的客户端来说,50MB对我来说太多了。
I feel kind of stuck:( Could some more experienced guys, tell me how do they access their EJBs remotely, using Glassfish 3
? As I have written above, I succeed with the first option, but 50MB are too much in my opinion for a simple client.
编辑:如果在远程服务器上的 ejbs
中有业务逻辑,您将从客户端选择哪种方式进行部署和远程访问?
What approach would you choose for deployment and remote access from the client, if you have the business logic in ejbs
on a remote server?
感谢您提供的任何建议!
Thanks for any suggestions you have!
祝您一切顺利,Petar
Wish you all the best, Petar
推荐答案
我认为你的案例中最好的方法是在你的服务器上创建一个Servlet(或其他一些简单的组件),让这个人和你的EJB通话,如果你选择这种情况,你会隔离哟ur客户端/服务器通信和业务逻辑实现。
I think the best approach in your case is to create a Servlet (or some other light simple component) in your server and make this guy talk to your EJB. If you choose this case, you will isolate your client/server comunication and your business logic implementation.
这篇关于EJB远程应用程序客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!