IOException {
try {
InitialContext ctx = new InitialContext();
Context enc = (Context) ctx.lookup("java:comp/env");
StatelessSessionHome home = (StatelessSessionHome) enc.lookup("ejb/OptimizedEJB");
StatelessSession bean = home.create();
bean.noop();
Object homeRef = enc.lookup("ejb/OptimizedEJB");
home = (StatelessSessionHome) PortableRemoteObject.narrow(homeRef, StatelessSessionHome.class);
bean = home.create();