DeploymentConfiguration config = mgr.createConfiguration(deployable);
final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);
EnvironmentData environment = new EnvironmentData();
connector.setEnvironment(environment);
org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
environment.setConfigId(configId);
configId.setGroupId("console.dbpool");
String artifactId = data.name;
if(artifactId.indexOf('/') != -1) {
// slash in artifact-id results in invalid configuration-id and leads to deployment errors
artifactId = artifactId.replaceAll("/", "%2F");
}
configId.setArtifactId(artifactId);
configId.setVersion("1.0");
configId.setType("rar");
String[] jars = data.getJars();
int length = jars[jars.length - 1].length() ==0? jars.length -1: jars.length;
org.apache.geronimo.deployment.service.jsr88.Artifact[] dependencies = new org.apache.geronimo.deployment.service.jsr88.Artifact[length];
for (int i=0; i<dependencies.length; i++) {
dependencies[i] = new org.apache.geronimo.deployment.service.jsr88.Artifact();
}
environment.setDependencies(dependencies);
for (int i=0; i<dependencies.length; i++) {
Artifact tmp = Artifact.create(jars[i]);
dependencies[i].setGroupId(tmp.getGroupId());
dependencies[i].setArtifactId(tmp.getArtifactId());
dependencies[i].setVersion(tmp.getVersion().toString());