1 2 3 4 5 6 7 8
| java.util.Hashtable hash = new java.util.Hashtable();
hash.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
hash.put(javax.naming.Context.PROVIDER_URL, "iiop://localhost:3700");
javax.naming.Context context = new javax.naming.InitialContext(hash);
Object ref = context.lookup("ejb/CholiBean");
choli.CholiRemoteHome home = (choli.CholiRemoteHome)javax.rmi.PortableRemoteObject.narrow(ref, choli.CholiRemoteHome.class);
choli.CholiRemote obj = home.create();
this.jLabel1.setText(obj.sayHello()); |