try {
// initialize the static naming service variables.
CorbaNamingContext.init(orb, rootPOA);
// create and initialize the root context instance according to the configuration.
CorbaNamingContext ns = new CorbaNamingContext();
Configuration configuration = ((org.jacorb.orb.ORB) orb).getConfiguration();
boolean doPurge = configuration.getAttribute("jacorb.naming.purge", "off").equals("on");
boolean noPing = configuration.getAttribute("jacorb.naming.noping", "off").equals("on");
ns.init(namingPOA, doPurge, noPing);
// create and activate the root context.
byte[] rootContextId = "root".getBytes();
namingPOA.activate_object_with_id(rootContextId, ns);
namingService = NamingContextExtHelper.narrow(namingPOA.create_reference_with_id(rootContextId,