for (DeploymentInfo deployment : deployments) {
String deploymentID = deployment.getDeploymentID() + "";
try {
Container container = deployment.getContainer();
container.undeploy(deployment);
deployment.setContainer(null);
} catch (Throwable t) {
undeployException.getCauses().add(new Exception("bean: " + deploymentID + ": " + t.getMessage(), t));
} finally {
((CoreDeploymentInfo)deployment).setDestroyed(true);