try {
Context ic = new InitialContext();
Object o = ic.lookup("Test1"); // replace with YOUR JNDI name for the bean
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);
Advice advisor = home.create();
System.out.println(advisor.getMessage());
} catch (Exception ex) {
ex.printStackTrace();
}