0

如何使用 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);

4

1 回答 1

0

尝试这个:

props.put(Context.PROVIDER_URL,"ejbd://127.0.0.1:4201");
于 2010-05-19T19:20:52.013 回答