hk2Tracker.open();
final Main main = (Main) hk2Tracker.waitForService(0);
hk2Tracker.close();
final ModulesRegistry mr = ModulesRegistry.class.cast(getBundleContext().getService(getBundleContext().getServiceReference(ModulesRegistry.class.getName())));
final Habitat habitat = main.createHabitat(mr, startupContext);
final ModuleStartup gfKernel = main.findStartupService(mr, habitat, null, startupContext);
GlassFish glassFish = createGlassFish(gfKernel, habitat, gfProps.getProperties());
gfs.add(glassFish);
getBundleContext().registerService(GlassFish.class.getName(), glassFish, gfProps.getProperties());
return glassFish;
} catch (BootException ex) {