webBeansContext = WebBeansContext.getInstance();
LOG.fine("OpenWebBeans Arquillian starting deployment");
ContainerLifecycle lifecycle = webBeansContext.getService(ContainerLifecycle.class);
lifecycleProducer.set(lifecycle);
beanManagerProducer.set(lifecycle.getBeanManager());
OwbArquillianScannerService dummyScannerService = (OwbArquillianScannerService) webBeansContext.getScannerService();
dummyScannerService.setArchive(archive);
final ClassLoader parentLoader = Thread.currentThread().getContextClassLoader();
originalLoader.set(parentLoader);
Thread.currentThread().setContextClassLoader(new OwbSWClassLoader(parentLoader, archive, useOnlyArchiveResources, useOnlyArchiveResourcesExcludes));
try
{
lifecycle.startApplication(null);
}
catch (WebBeansDeploymentException e)
{
throw new DeploymentException(e.getMessage(), e);
}