throw new DeploymentException("Error parsing web.xml", xmle);
}
check(webApp);
// parse vendor dd
JettyWebAppType jettyWebApp = getJettyWebApp(plan, moduleFile, standAlone, targetPath, webApp);
if (contextRoot == null) {
if (jettyWebApp.isSetContextRoot()) {
contextRoot = jettyWebApp.getContextRoot();
} else {
contextRoot = determineDefaultContextRoot(webApp, standAlone, moduleFile, targetPath);
}
}
Map servletNameToPathMap = buildServletNameToPathMap(webApp, contextRoot);
//look for a webservices dd
Map portMap = Collections.EMPTY_MAP;
try {
URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
portMap = webServiceBuilder.parseWebServiceDescriptor(wsDDUrl, moduleFile, false, servletNameToPathMap);
} catch (MalformedURLException e) {
//no descriptor
}
// get the ids from either the application plan or for a stand alone module from the specific deployer
URI configId = null;
try {
configId = new URI(jettyWebApp.getConfigId());
} catch (URISyntaxException e) {
throw new DeploymentException("Invalid configId " + jettyWebApp.getConfigId(), e);
}
List parentId = ServiceConfigBuilder.getParentID(jettyWebApp.getParentId(), jettyWebApp.getImportArray());
if (parentId.isEmpty()) {
parentId = new ArrayList(defaultParentId);
}
WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap, JETTY_NAMESPACE);
return module;