// Register the {@link RuntimeEnvironment}, {@link ResourceInstaller} services
registerServices(servletContext, runtime);
// Install and start this webapp as a module
WebAppContextListener webappInstaller = new WebAppContextListener();
Module module = webappInstaller.installWebappModule(servletContext);
servletContext.setAttribute(Module.class.getName(), module);
try {
module.start();
} catch (ModuleException ex) {
throw new IllegalStateException(ex);