final List<Metadata<Extension>> extensions = deploymentUnit.getAttachmentList(WeldAttachments.PORTABLE_EXTENSIONS);
final WeldDeployment deployment = new WeldDeployment(beanDeploymentArchives, extensions, module, subDeploymentLoaders);
final WeldContainer weldContainer = new WeldContainer(deployment, Environments.EE_INJECT);
//hook up validation service
//TODO: we need to change weld so this is a per-BDA service
final ValidatorFactory factory = deploymentUnit.getAttachment(BeanValidationAttachments.VALIDATOR_FACTORY);
weldContainer.addWeldService(ValidationServices.class, new WeldValidationServices(factory));
final EjbInjectionServices ejbInjectionServices = new WeldEjbInjectionServices(deploymentUnit.getServiceRegistry(), eeModuleDescription, eeApplicationDescription, deploymentRoot.getRoot());
weldContainer.addWeldService(EjbInjectionServices.class, ejbInjectionServices);
rootBeanDeploymentModule.addService(EjbInjectionServices.class, ejbInjectionServices);
weldContainer.addWeldService(EjbServices.class, new WeldEjbServices(deploymentUnit.getServiceRegistry()));
final JpaInjectionServices rootJpaInjectionServices = new WeldJpaInjectionServices(deploymentUnit, deploymentUnit.getServiceRegistry());
weldContainer.addWeldService(JpaInjectionServices.class, rootJpaInjectionServices);
final WeldService weldService = new WeldService(weldContainer, deploymentUnit.getName());
// add the weld service
final ServiceBuilder<WeldContainer> weldServiceBuilder = serviceTarget.addService(weldServiceName, weldService);