moduleDoc = (ModuleDocument) xmlObject;
} else {
moduleDoc = (ModuleDocument) xmlObject.changeType(ModuleDocument.type);
}
Collection errors = new ArrayList();
if (!moduleDoc.validate(XmlBeansUtil.createXmlOptions(errors))) {
throw new DeploymentException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + moduleDoc.toString());
}
// If there's no artifact ID and we won't be able to figure one out later, use the plan file name. Bit of a hack.
if(jarFile == null && (moduleDoc.getModule().getEnvironment() == null ||
moduleDoc.getModule().getEnvironment().getModuleId() == null ||