// check for beans.xml
if (resourceLoader.getResource(WeldDeployment.BEANS_XML) == null) {
throw CommonLogger.LOG.missingBeansXml();
}
final CDI11Bootstrap bootstrap;
try {
bootstrap = (CDI11Bootstrap) resourceLoader.classForName(BOOTSTRAP_IMPL_CLASS_NAME).newInstance();
} catch (InstantiationException ex) {
throw CommonLogger.LOG.errorLoadingWeld();
} catch (IllegalAccessException ex) {
throw CommonLogger.LOG.errorLoadingWeld();
}
Deployment deployment = createDeployment(resourceLoader, bootstrap);
// Set up the container
bootstrap.startContainer(containerId, Environments.SE, deployment);
// Start the container
bootstrap.startInitialization();
bootstrap.deployBeans();
bootstrap.validateBeans();
bootstrap.endInitialization();
final BeanManager manager = bootstrap.getManager(deployment.loadBeanDeploymentArchive(WeldContainer.class));
// Set up the ShutdownManager for later
this.shutdownManager = new ShutdownManager(bootstrap, manager);
WeldContainer container = getInstanceByType(manager, WeldContainer.class);