Context jndiContext = getInitialContext ();
Object obj = jndiContext.lookup ("TravelAgentHomeRemote");
TravelAgentHomeRemote tahome = (TravelAgentHomeRemote)
javax.rmi.PortableRemoteObject.narrow (obj, TravelAgentHomeRemote.class);
TravelAgentRemote tagent = tahome.create (null);
System.out.println ("Calling TravelAgentBean to create sample data..");
Collection results = tagent.buildSampleData ();
tagent.remove ();
Iterator iterator = results.iterator ();
while (iterator.hasNext ())
{
String ss = (String)(iterator.next ());
System.out.println (ss);
}