}
GerApplicationType gerApplication = null;
try {
// load the geronimo-application.xml from either the supplied plan or from the earFile
GerApplicationDocument gerApplicationDoc = null;
try {
if (planFile != null) {
gerApplicationDoc = GerApplicationDocument.Factory.parse(planFile);
} else {
URL path = DeploymentUtil.createJarURL(earFile, "META-INF/geronimo-application.xml");
gerApplicationDoc = GerApplicationDocument.Factory.parse(path);
}
} catch (IOException e) {
}
// if we got one extract the validate it otherwise create a default one
if (gerApplicationDoc != null) {
gerApplicationDoc = (GerApplicationDocument) SchemaConversionUtils.convertToGeronimoServiceSchema(gerApplicationDoc);
gerApplicationDoc = (GerApplicationDocument) SchemaConversionUtils.convertToGeronimoNamingSchema(gerApplicationDoc);
gerApplicationDoc = (GerApplicationDocument) SchemaConversionUtils.convertToGeronimoSecuritySchema(gerApplicationDoc);
SchemaConversionUtils.validateDD(gerApplicationDoc);
gerApplication = gerApplicationDoc.getApplication();
} else {
gerApplication = createDefaultPlan(application, earFile);
}
} catch (XmlException e) {
throw new DeploymentException(e);