{
log.debug("+++ testDeepRunAs");
login();
Object obj = getInitialContext().lookup("spec.Level1CallerBean");
obj = PortableRemoteObject.narrow(obj, CalledSessionHome.class);
CalledSessionHome home = (CalledSessionHome) obj;
log.debug("Found Level1CallerBean Home");
CalledSession bean = home.create();
log.debug("Created spec.Level1CallerBean");
bean.callEcho();
log.debug("Bean.callEcho() ok");
bean.remove();
// Make sure we cannot access Level2CallerBean remotely
obj = getInitialContext().lookup("spec.Level2CallerBean");
obj = PortableRemoteObject.narrow(obj, CalledSessionHome.class);
home = (CalledSessionHome) obj;
log.debug("Found Level2CallerBean Home");
try
{
bean = home.create();
fail("Was able to create Level2CallerBean");
}
catch (ServerException e)
{
AccessException ae = (AccessException) e.detail;