从远程独立客户端访问WAR中的EJB [英] Accessing EJB in WAR from remote standalone client

查看:94
本文介绍了从远程独立客户端访问WAR中的EJB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从Swing客户端以及通过servlet / JSP在本地访问的EJB。我想将EJB的包装从EJB / WAR / EAR切换到EJB / WAR,因为它的使用更简单。

I have an EJB accessed remotely from a Swing client as well as locally by servlet/JSP. I want to switch the packaging for my EJB from a EJB/WAR/EAR to a EJB/WAR since it is simpler to work with.

简单是什么意思?例如,在Eclipse中,我可以有一个包含EJB / web类的项目,而不是一个EJB + WAR + EAR项目(我的客户在Eclipse中是一个单独的项目)。

What do I mean by simpler? In Eclipse, for example, I can have a single project with my EJB/web classes rather than having a EJB + WAR + EAR project (My client is a separate project in Eclipse).

是否可以将EJB打包在WAR中并可以远程访问?

Is it possible to package a EJB in a WAR and have it be accessible remotely?

推荐答案

根据网络配置文件和EJB 3.1规范,只需要Java EE Web配置文件产品提供EJB Lite,它不支持EJB的远程客户端。

According to the web profile and EJB 3.1 specs, Java EE web profile products are only required to provide EJB Lite, which doesn't support remote clients to EJBs.

但是它们可以提供远程ejb客户端连接作为产品的可选组件。

But they can provide remote ejb client connection as a product optional component.

因此,如果要将远程EJB打包在WAR中,则必须寻找提供此服务的Java EE Web服务器。并且请注意,其他Java EE 6 Web服务器也不需要这样做。

So if you want to package remote EJBs in a WAR you'll have to look for a Java EE web server that provides this service and be aware that the same behaviour isn't required in other Java EE 6 web servers.

有用的链接:
http://download.oracle.com/otndocs/jcp/javaee_web_profile-6.0-fr-e val-oth-JSpec /

http://download.oracle.com/otndocs/jcp/ejb-3.1-fr-eval-oth-JSpec/

这篇关于从远程独立客户端访问WAR中的EJB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆