// now that everything is configured, deploy to the container
if (start) {
// deploy
for (BeanContext deployment : allDeployments) {
try {
Container container = deployment.getContainer();
container.deploy(deployment);
logger.info("createApplication.createdEjb", deployment.getDeploymentID(), deployment.getEjbName(), container.getContainerID());
if (logger.isDebugEnabled()) {
for (Map.Entry<Object, Object> entry : deployment.getProperties().entrySet()) {
logger.info("createApplication.createdEjb.property", deployment.getEjbName(), entry.getKey(), entry.getValue());
}
}
} catch (Throwable t) {
throw new OpenEJBException("Error deploying '"+deployment.getEjbName()+"'. Exception: "+t.getClass()+": "+t.getMessage(), t);
}
}
// start
for (BeanContext deployment : allDeployments) {
try {
Container container = deployment.getContainer();
container.start(deployment);
logger.info("createApplication.startedEjb", deployment.getDeploymentID(), deployment.getEjbName(), container.getContainerID());
} catch (Throwable t) {
throw new OpenEJBException("Error starting '"+deployment.getEjbName()+"'. Exception: "+t.getClass()+": "+t.getMessage(), t);
}
}
}