throw DeploymentException.rethrowAsDeploymentException("Cannot deploy WBD.", e);
}
if (urls.isEmpty() == false)
{
Module module = unit.getAttachment(Module.class);
if (module == null)
{
VFSDeploymentUnit parent = unit.getParent();
while (parent != null && module == null)
{
module = parent.getAttachment(Module.class);
parent = parent.getParent();
}
if (module == null)
throw new DeploymentException("No module in deployment unit's hierarchy: " + unit.getName());
}
WBDiscoveryVisitor visitor = new WBDiscoveryVisitor(wbdi);
module.visit(visitor, ClassFilter.INSTANCE, null, urls.toArray(new URL[urls.size()]));
}
}