addressBook = (AddressBook)session.getAttribute(owner + "-" + ADDRESSBOOK_ATTR);
if (addressBook == null) {
Hashtable properties = new Properties();
//properties.put(Context.INITIAL_CONTEXT_FACTORY,
// "com.sun.jndi.cosnaming.CNCtxFactory");
//properties.put(Context.PROVIDER_URL, "iiop://wgs97-74:1050");
InitialContext ic = new InitialContext(properties);
Object personRef = ic.lookup("ejb/AddressBook");
AddressBookHome addressBookHome =
(AddressBookHome)PortableRemoteObject.narrow(personRef,
AddressBookHome.class);
try {
System.out.println("Creating new book: " + owner);
addressBook = addressBookHome.create(owner);
session.setAttribute(owner + "-" + ADDRESSBOOK_ATTR, addressBook);
} catch(Exception ex) {
ex.printStackTrace();
}
}