} else {
LOGGER.info("Deploying WAB {} at {}", new Object[] {bundle, contextPath});
ModuleIDBuilder idBuilder = new ModuleIDBuilder();
Kernel kernel = extender.getKernel();
Naming naming = kernel.getNaming();
ModuleBuilder webModuleBuilder = extender.getWebModuleBuilder();
if (webModuleBuilder == null) {
throw new DeploymentException("Unable to deploy " + bundle + " WAB. No web module builders found.");
}
WebModule webModule = (WebModule) webModuleBuilder.createModule(bundle, naming, idBuilder);
BundleDeploymentContext deploymentContext =
new BundleDeploymentContext(
webModule.getEnvironment(),
ConfigurationModuleType.WAB,
naming,
configurationManager,
bundle.getBundleContext(),
extender.getServerName(),
webModule.getModuleName(),
extender.getTransactionManagerObjectName(),
extender.getConnectionTrackerObjectName(),
extender.getCorbaGBeanObjectName(),
new HashMap(),
bundle);
webModule.setEarContext(deploymentContext);
webModule.setRootEarContext(deploymentContext);
deploymentContext.flush();
deploymentContext.initializeConfiguration();
webModule.getJndiScope(JndiScope.app).put("app/AppName", webModule.getName());
webModuleBuilder.initContext(deploymentContext, webModule, bundle);
AbstractName appJndiName = naming.createChildName(deploymentContext.getModuleName(), "ApplicationJndi", "ApplicationJndi");
deploymentContext.getGeneralData().put(EARContext.APPLICATION_JNDI_NAME_KEY, appJndiName);
webModuleBuilder.addGBeans(deploymentContext, webModule, bundle, extender.getRepositories());
GBeanData appContexts = new GBeanData(appJndiName, ApplicationJndi.class);