try{
Context jndiContext = getInitialContext();
TravelAgentHome home =
(TravelAgentHome)jndiContext.lookup(
"TravelAgentHome");
TravelAgent reserve = home.create();
// get a list of all cabins on ship 1 with a bed count of 3
String list [] = reserve.listCabins(SHIP_ID,BED_COUNT);
for(int i = 0; i < list.length; i++){
System.out.println(list[i]);
}
}catch(java.rmi.RemoteException re){re.printStackTrace();}
catch(Throwable t){t.printStackTrace();}