private void tryLookup() {
Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
try {
Context ctx = new InitialContext(p);
CalculatorLocal local = (CalculatorLocal) ctx.lookup("CalculatorBeanLocal");
System.out.println("lookup OK: " + local.sayHello());
} catch (NamingException e) {
System.out.println("can't lookup bean: " + e.getMessage());
}
}