obj = ctx.lookup("CertificateData"); certhome = (CertificateDataHome) javax.rmi.PortableRemoteObject.narrow(obj, CertificateDataHome.class);
    protected void setUp() throws Exception {        log.debug(">setUp()");        // Install BouncyCastle provider        CertTools.installBCProvider();        // We want to get error responses without exceptions        HttpUnitOptions.setExceptionsThrownOnErrorStatus(false);        admin = new Admin(Admin.TYPE_BATCHCOMMANDLINE_USER);        ctx = getInitialContext();        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);        }        CAInfo cainfo = casession.getCAInfo(admin, caid);        Collection certs = cainfo.getCertificateChain();        if (certs.size() > 0) {            Iterator certiter = certs.iterator();            cacert = (X509Certificate) certiter.next();        } else {            log.error("NO CACERT for caid " + caid);        }        obj = ctx.lookup("RSASignSession");        home = (ISignSessionHome) javax.rmi.PortableRemoteObject.narrow(obj, ISignSessionHome.class);        remote = home.create();        obj = ctx.lookup("UserData");        userhome = (UserDataHome) javax.rmi.PortableRemoteObject.narrow(obj, UserDataHome.class);        obj = ctx.lookup("CertificateData");        certhome = (CertificateDataHome) javax.rmi.PortableRemoteObject.narrow(obj, CertificateDataHome.class);        unknowncacert = CertTools.getCertfromByteArray(unknowncacertBytes);        log.debug("<setUp()");    }