1 4 package samplehttp.beans; 5 6 import java.rmi.RemoteException; 7 import java.util.Collection; 8 import javax.naming.Context; 9 import javax.naming.InitialContext; 10 import javax.naming.NamingException; 11 import javax.rmi.PortableRemoteObject; 12 13 16 public class SessClient { 17 18 static Context ctx = null; 19 static SessHome home = null; 20 21 public static void main(String[] arg) { 22 23 try { 25 ctx = new InitialContext(); 26 } catch (NamingException e) { 27 e.printStackTrace(); 28 System.exit(2); 29 } 30 31 String bName = "sessSessSLRHome"; 33 try { 34 home = (SessHome) PortableRemoteObject.narrow(ctx.lookup(bName), SessHome.class); 35 } catch(Exception e) { 36 e.printStackTrace(); 37 System.exit(2); 38 } 39 40 } 42 } 43 | Popular Tags |