InitialContext ctx = new InitialContext(env);
Object obj = ctx.lookup("excluded/MissingMethodBean");
obj = PortableRemoteObject.narrow(obj, CalledSessionHome.class);
CalledSessionHome home = (CalledSessionHome) obj;
log.debug("Found CalledSessionHome");
CalledSession bean = home.create();
log.debug("Created CalledSession");
// This should pass due to login role
bean.invokeEcho("testMissingIsExcluded");
// This should faile due to excluded for missing method-permission
try
{
bean.callEcho();
fail("Was able to invoke callEcho");
}
catch(AccessException e)
{
log.debug("Failed with AccessException");
}
bean.remove();
}