initialize the default WebBundleDescriptor from
default-web.xml
DOLLoadingContextFactory.setParsingDefaultWebXML(true);
FileInputStream fis = null;
WebBundleDescriptor wbd = null;
try {
// parse default-web.xml contents
// (this path will not be invoked by portable static verifier)
if (ApplicationServer.getServerContext() != null) {
InstanceEnvironment iEnv = ApplicationServer.getServerContext(
).getInstanceEnvironment();
String defaultWebXMLPath = iEnv.getConfigDirPath() +
File.separator + DEFAULT_WEB_XML;
File file = new File(defaultWebXMLPath);
if (file.exists()) {
fis = new FileInputStream(file);
WebDeploymentDescriptorFile wddf =
new WebDeploymentDescriptorFile();
wddf.setXMLValidation(false);
wbd = (WebBundleDescriptor) wddf.read(fis);
}
}
return wbd;
} catch (Exception e) {
DOLUtils.getDefaultLogger().log(Level.WARNING,
"enterprise.deployment.default.web.xml.not.parsed",
new Object[] {e.getMessage()});
return null;
} finally {
DOLLoadingContextFactory.setParsingDefaultWebXML(false);
try {
if (fis != null) {
fis.close();
}
} catch (IOException ioe) {
// do nothing
}
}