if (!file.exists() || !file.isAbsolute())
{
// Should be an relative to the top deployment
VFSDeploymentUnit topUnit = vfsUnit.getTopLevel();
if (topUnit == unit)
throw new DeploymentException("Unable to resolve " + altDDPath + " as WEB-INF path");
altDD = topUnit.getFile(altDDPath);
if (altDD == null)
throw new DeploymentException("Unable to resolve " + altDDPath + " as a deployment path");
VirtualFile altDDFile = root.getChild("WEB-INF/" + altDD.getName());
log.debug("Copying the altDD to: " + altDDFile);
VFSUtils.writeFile(altDDFile, altDD.openStream());
metaData.setAlternativeDD(altDDFile.getPathName());
}
}
}
}
ClassLoadingMetaData classLoading = metaData.getClassLoading();
if (classLoading == null)
classLoading = new ClassLoadingMetaData();
// pass in the java2ClassLoadingCompliance if it was not set at the war level
if (classLoading.wasJava2ClassLoadingComplianceSet() == false)
classLoading.setJava2ClassLoadingCompliance(this.java2ClassLoadingCompliance);
metaData.setClassLoading(classLoading);
// Build the context root if its not been set or is specified at the ear
String webContext = metaData.getContextRoot();
webContext = buildWebContext(webContext, warName, metaData, unit);
metaData.setContextRoot(webContext);
AbstractWarDeployment deployment = getDeployment(unit, metaData);
deployment.setMainDeployer(mainDeployer);
// TODO: until deployment is a MC bean
deployment.setPersistenceUnitDependencyResolver(persistenceUnitDependencyResolver);
deployWebModule(unit, metaData, deployment);
}
catch (Exception e)
{
throw new DeploymentException("Failed to create web module", e);
}
}