Object obj = ctx.lookup("RSASignSession");
Object obj = ctx.lookup("CAAdminSession"); ICAAdminSessionHome cahome = (ICAAdminSessionHome) javax.rmi.PortableRemoteObject.narrow(obj, ICAAdminSessionHome.class); ICAAdminSessionRemote casession = cahome.create(); Collection caids = casession.getAvailableCAs(admin); Iterator iter = caids.iterator(); if (iter.hasNext()) { caid = ((Integer)iter.next()).intValue(); } else { assertTrue("No active CA! Must have at least one active CA to run tests!", false); } obj = ctx.lookup("RSASignSession");
    protected void setUp() throws Exception {        log.debug(">setUp()");        // Install BouncyCastle provider        Provider BCJce = new org.bouncycastle.jce.provider.BouncyCastleProvider();        int result = Security.addProvider(BCJce);        ctx = getInitialContext();        Object obj = ctx.lookup("RSASignSession");        home = (ISignSessionHome) javax.rmi.PortableRemoteObject.narrow(obj, ISignSessionHome.class);        remote = home.create();        Iterator certs = remote.getCertificateChain(new Admin(Admin.TYPE_BATCHCOMMANDLINE_USER), "TODO".hashCode()).iterator();        caid = ((X509Certificate) certs.next()).getIssuerDN().toString().hashCode();                           Object obj1 = ctx.lookup("UserData");        userhome = (UserDataHome) javax.rmi.PortableRemoteObject.narrow(obj1, UserDataHome.class);        log.debug("<setUp()");    }