InputStream is = null;
InputStream is2 = null;
try {
// apply the runtime settings if any
is = archive.getEntry(ddFileEntryName);
DeploymentDescriptorFile confDD = getConfigurationDDFile();
if (archive.getURI() != null) {
confDD.setErrorReportingString(archive.getURI().getSchemeSpecificPart());
}
DeploymentDescriptorFile sunConfDD = getSunConfigurationDDFile();
if (sunConfDD != null) {
is2 = archive.getEntry(sunConfDD.getDeploymentDescriptorPath());
}
if (is != null && confDD != null) {
if (is2 != null && warnIfMultipleDDs) {
logger.log(Level.WARNING, "gf.counterpart.configdd.exists",
new Object[] {
sunConfDD.getDeploymentDescriptorPath(),
archive.getURI().getSchemeSpecificPart(),
ddFileEntryName});
}
confDD.setXMLValidation(getRuntimeXMLValidation());
confDD.setXMLValidationLevel(runtimeValidationLevel);
confDD.read(descriptor, is);
} else {
// try to read from the legacy sun deployment descriptor
if (is2 != null && sunConfDD != null) {
logger.log(Level.FINE, "sun.configdd.deprecate",
new Object[] {
sunConfDD.getDeploymentDescriptorPath(),
archive.getURI().getSchemeSpecificPart(),
ddFileEntryName});
if (archive.getURI() != null) {
sunConfDD.setErrorReportingString(
archive.getURI().getSchemeSpecificPart());
}
sunConfDD.setXMLValidation(getRuntimeXMLValidation());
sunConfDD.setXMLValidationLevel(runtimeValidationLevel);
sunConfDD.read(descriptor, is2);
}
}
} finally {
if (is != null) {
try {