throw new DeploymentException("Cannot unmarshall the ra.xml file: " + specDDUrl.toExternalForm(), e);
} catch (Exception e) {
throw new DeploymentException("Encountered unknown error parsing the ra.xml file: " + specDDUrl.toExternalForm(), e);
}
}
GerConnectorType gerConnector = null;
try {
// load the geronimo connector plan from either the supplied plan or from the earFile
try {
if (plan instanceof XmlObject) {
gerConnector = (GerConnectorType) SchemaConversionUtils.getNestedObjectAsType((XmlObject) plan,
CONNECTOR_QNAME,
GerConnectorType.type);
} else {
GerConnectorDocument gerConnectorDoc;
ArrayList errors = new ArrayList();
if (plan != null) {
gerConnectorDoc = GerConnectorDocument.Factory.parse((File) plan, XmlBeansUtil.createXmlOptions(errors));
} else {
URL path = JarUtils.createJarURL(moduleFile, "META-INF/geronimo-ra.xml");
gerConnectorDoc = GerConnectorDocument.Factory.parse(path, XmlBeansUtil.createXmlOptions(errors));
}
if (errors.size() > 0) {
throw new DeploymentException("Could not parse connector doc: " + errors);
}
if (gerConnectorDoc != null) {
gerConnector = gerConnectorDoc.getConnector();
}
}
} catch (IOException e) {
//do nothing
}
// if we got one extract the validate it otherwise create a default one
if (gerConnector == null) {
throw new DeploymentException("A connector module must be deployed using a Geronimo deployment plan" +
" (either META-INF/geronimo-ra.xml in the RAR file or a standalone deployment plan passed to the deployer).");
}
ConnectorPlanRectifier.rectifyPlan(gerConnector);
XmlCursor cursor = gerConnector.newCursor();
try {
SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
} finally {
cursor.dispose();
}
XmlBeansUtil.validateDD(gerConnector);
} catch (XmlException e) {
throw new DeploymentException("Could not parse module descriptor", e);
}
EnvironmentType environmentType = gerConnector.getEnvironment();
Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
if (earEnvironment != null) {
EnvironmentBuilder.mergeEnvironments(earEnvironment, environment);
environment = earEnvironment;
if (!environment.getConfigId().isResolved()) {