2010-05-04 84 views
0

如何使用Open EJB访问部署在websphere社区服务器上的EJB?我正在尝试使用类似以下的代码,但不知道如何使用URL。注意我已经使用ejb:和IIOP URL前缀尝试了端口2809和1099。使用Open EJB访问部署在websphere社区服务器上的EJB?

  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);

+0

什么是客户端? Web应用程序还部署到WAS或独立应用程序?要么 ...? – djna 2010-05-04 15:09:36

+0

我希望客户端是一个独立的控制台应用程序。 – Jared 2010-05-04 15:34:20

回答

0

试试这个:

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