调用部署在websphere上的EJB

来源:互联网 发布:电脑软件没了 编辑:程序博客网 时间:2024/04/30 05:19
public static void main(String[] args) {String naming_factory = "com.sun.jndi.cosnaming.CNCtxFactory";String namespace_address = "iiop://localhost:2809";String home_address = "nodes/IT-chenanshengNode01/servers/server1/com/mangocity/pay/creditcard/interfaces/ICBCEpos";Hashtable environment = new Hashtable();environment.put(Context.INITIAL_CONTEXT_FACTORY, naming_factory);environment.put(Context.PROVIDER_URL, namespace_address);try {Context ctx = new InitialContext(environment);Object obj = ctx.lookup(home_address);ICBCEposHome icbcEposHome = (ICBCEposHome) PortableRemoteObject.narrow(obj, ICBCEposHome.class);ICBCEpos icbcEpos = icbcEposHome.create();System.out.println(icbcEpos.authenticate("", "", "", "", ""));} catch (Exception e) {e.printStackTrace();}}
原创粉丝点击