【问题标题】:Accessing an EJB deployed on websphere community server using Open EJB?使用 Open EJB 访问部署在 websphere 社区服务器上的 EJB?
【发布时间】: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


【解决方案1】:

试试这个:

props.put(Context.PROVIDER_URL,"ejbd://127.0.0.1:4201");

【讨论】:

    猜你喜欢
    • 2012-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-19
    • 2018-07-10
    • 2015-03-20
    • 1970-01-01
    • 2013-02-23
    相关资源
    最近更新 更多