2010-05-04 42 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");