InitialContext ctx = new InitialContext(); Session remote = (Session) ctx.lookup("SessionBean/remote"); while (true) { remote.test(); Thread.sleep(1000); }