} catch (XmlException e) {
throw new DeploymentException(e);
}
EnvironmentType environmentType = gerConnector.getEnvironment();
Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
if (earEnvironment != null) {
EnvironmentBuilder.mergeEnvironments(earEnvironment, environment);
environment = earEnvironment;
if(!environment.getConfigId().isResolved()) {
throw new IllegalStateException("Connector module ID should be fully resolved (not "+environment.getConfigId()+")");
}
} else {
idBuilder.resolve(environment, new File(moduleFile.getName()).getName(), "rar");
}
AbstractName moduleName;
if (earName == null) {
earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
moduleName = naming.createChildName(earName, environment.getConfigId().toString(), NameFactory.RESOURCE_ADAPTER_MODULE);
} else {
moduleName = naming.createChildName(earName, targetPath, NameFactory.RESOURCE_ADAPTER_MODULE);
}
boolean standAlone = earEnvironment == null;