【发布时间】:2010-05-04 14:55:28
【问题描述】:
如何使用 Open EJB 访问部署在 websphere 社区服务器上的 EJB?我正在尝试使用如下代码,但不确定 URL 使用什么。请注意,我已经尝试使用 ejb: 和 IIOP URL 前缀的端口 2809 和 1099。
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.RemoteInitialContextFactory");
props.put(Context.PROVIDER_URL,"IIOP://127.0.0.1:2809");
Context ctx = new InitialContext(props);
Object ref = ctx.lookup("CalculatorRemote ");
CalculatorImpl h = (CalculatorImpl )PortableRemoteObject.narrow(ref,CalculatorImpl.class);
【问题讨论】:
-
什么是客户端?一个 webapp 也部署到 WAS 或一个独立的应用程序?还是……?
-
我希望客户端是一个独立的控制台应用程序。
标签: ejb-3.0 websphere ejb openejb