Following code creates initial naming context, obtains environment naming context and retrieves the bounded object.
Code:Context initial = new InitialContext();
Object objref = initial.lookup("java:comp/env/ejb/SimpleConverter");
HomeInterface home =
(HomeInterface)PortableRemoteObject.narrow(objref, HomeInterface.class);
