LOGGER.tracef("Uninstall deployment: %s", dep);
try {
// Undeploy through the deployment manager
DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
String contextName = DeploymentHolderService.getContextName(dep);
builder = builder.undeploy(contextName).remove(contextName);
DeploymentPlan plan = builder.build();
DeploymentAction removeAction = builder.getLastAction();
executeDeploymentPlan(plan, removeAction);
} catch (Exception ex) {
LOGGER.warnCannotUndeployBundle(ex, dep);