try{
Context jndiContext = getInitialContext();
TravelAgentHome home =
(TravelAgentHome)jndiContext.lookup("TravelAgentHome");
// get a remote reference to the bean (EJB object)
TravelAgent agent = home.create();
// pass the remote reference to some method
getTheEJBHome(agent);
}catch(java.rmi.RemoteException re){re.printStackTrace();}
catch(Throwable t){t.printStackTrace();}