InitialContext ctx = new InitialContext(env);
Object ref = ctx.lookup("ejbcts/CMPBean");
CtsCmpHome home = (CtsCmpHome)
PortableRemoteObject.narrow(ref, CtsCmpHome.class);
AccountPK pk1 = new AccountPK("bean1");
CtsCmp bean1 = home.create(pk1, "testHomeFromRemoteNoDefaultJNDI");
CtsCmpHome home2 = (CtsCmpHome) bean1.getEJBHome();
AccountPK pk2 = new AccountPK("bean2");
CtsCmp bean2 = home2.create(pk2, "testHomeFromRemoteNoDefaultJNDI");
bean2.remove();
}
finally
{
System.setProperties(sysProps);
}