return null;
}
} finally {
cursor.dispose();
}
ConfigurationDocument configurationDoc;
if (xmlObject instanceof ConfigurationDocument) {
configurationDoc = (ConfigurationDocument) xmlObject;
} else {
configurationDoc = (ConfigurationDocument) xmlObject.changeType(ConfigurationDocument.type);
}
Collection errors = new ArrayList();
if (!configurationDoc.validate(XmlBeansUtil.createXmlOptions(errors))) {
throw new DeploymentException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + configurationDoc.toString());
}
return configurationDoc.getConfiguration();
} catch (XmlException e) {
throw new DeploymentException("Could not parse xml in plan", e);
} catch (IOException e) {
throw new DeploymentException("no plan at " + planFile, e);
}