try {
if (plan instanceof XmlObject) {
XmlObject object = SchemaConversionUtils.getNestedObject((XmlObject) plan, "web-app");
jettyWebApp = TemporaryPlanAdapter.convertJettyElementToWeb(object);
} else {
GerWebAppDocument jettyWebAppdoc = null;
if (plan != null) {
XmlObject object = SchemaConversionUtils.parse(((File) plan).toURL());
jettyWebAppdoc = TemporaryPlanAdapter.convertJettyDocumentToWeb(object);
} else {
URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-web.xml");
try {
jettyWebAppdoc = GerWebAppDocument.Factory.parse(path);
} catch (FileNotFoundException e) {
path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-jetty.xml");
XmlObject object = SchemaConversionUtils.parse(path);
if(object != null) {
log.error("Incorrect deployment plan naming: found geronimo-jetty.xml, should be geronimo-web.xml");
jettyWebAppdoc = TemporaryPlanAdapter.convertJettyDocumentToWeb(object);
}
}
}
if (jettyWebAppdoc != null) {
jettyWebApp = jettyWebAppdoc.getWebApp();
}
}
} catch (IOException e) {
log.warn(e);
}