Buggy code:
final ResourceRoot deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; if ( ! ( WeldDeploymentMarker . isPartOfWeldDeployment ( deploymentUnit ) ) ) { if ( ( ( deploymentUnit . getParent ( ) ) == null ) && ( CdiAnnotationMarker . cdiAnnotationsPresent ( deploymentUnit ) ) ) { DEPLOYMENT_LOGGER . cdiAnnotationsButNoBeansXML ( deploymentUnit ) ; } return ; } final ServiceName weldServiceName = parent . getServiceName ( ) . append ( SERVICE_NAME ) ; deploymentUnit . addToAttachmentList ( WEB_DEPENDENCIES , weldServiceName ) ; final Set < ServiceName > jpaServices = new HashSet < ServiceName > ( ) ; if ( ( deploymentUnit . getParent ( ) ) != null ) { return ; } DEPLOYMENT_LOGGER . startingServicesForCDIDeployment ( phaseContext . getDeploymentUnit ( ) . getName ( ) ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; final Set < BeanDeploymentArchiveImpl > beanDeploymentArchives = new HashSet < BeanDeploymentArchiveImpl > ( ) ; final Map < ModuleIdentifier , BeanDeploymentModule > bdmsByIdentifier = new HashMap < ModuleIdentifier , BeanDeploymentModule > ( ) ; final Map < ModuleIdentifier , ModuleSpecification > moduleSpecByIdentifier = new HashMap < ModuleIdentifier , ModuleSpecification > ( ) ; final BeanDeploymentModule rootBeanDeploymentModule = deploymentUnit . getAttachment ( BEAN_DEPLOYMENT_MODULE ) ; final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final EEApplicationDescription eeApplicationDescription = deploymentUnit . getAttachment ( EE_APPLICATION_DESCRIPTION ) ; bdmsByIdentifier . put ( module . getIdentifier ( ) , rootBeanDeploymentModule ) ; moduleSpecByIdentifier . put ( module . getIdentifier ( ) , moduleSpecification ) ; beanDeploymentArchives . addAll ( rootBeanDeploymentModule . getBeanDeploymentArchives ( ) ) ; final List < DeploymentUnit > subDeployments = deploymentUnit . getAttachmentList ( SUB_DEPLOYMENTS ) ; final Set < ClassLoader > subDeploymentLoaders = new HashSet < ClassLoader > ( ) ; getJpaDependencies ( deploymentUnit , jpaServices ) ; for ( DeploymentUnit subDeployment : subDeployments ) { getJpaDependencies ( deploymentUnit , jpaServices ) ; final Module subDeploymentModule = subDeployment . getAttachment ( MODULE ) ; if ( subDeploymentModule == null ) { continue ; } subDeploymentLoaders . add ( subDeploymentModule . getClassLoader ( ) ) ; final ModuleSpecification subDeploymentModuleSpec = subDeployment . getAttachment ( MODULE_SPECIFICATION ) ; final BeanDeploymentModule bdm = subDeployment . getAttachment ( BEAN_DEPLOYMENT_MODULE ) ; if ( bdm == null ) { continue ; } beanDeploymentArchives . addAll ( bdm . getBeanDeploymentArchives ( ) ) ; bdmsByIdentifier . put ( subDeploymentModule . getIdentifier ( ) , bdm ) ; moduleSpecByIdentifier . put ( subDeploymentModule . getIdentifier ( ) , subDeploymentModuleSpec ) ; final ResourceRoot subDeploymentRoot = subDeployment . getAttachment ( DEPLOYMENT_ROOT ) ; final EjbInjectionServices ejbInjectionServices = new org . jboss . as . weld . services . bootstrap . WeldEjbInjectionServices ( deploymentUnit . getServiceRegistry ( ) , eeModuleDescription , eeApplicationDescription , subDeploymentRoot . getRoot ( ) ) ; bdm . addService ( EjbInjectionServices . class , ejbInjectionServices ) ; } for ( Map . Entry < ModuleIdentifier , BeanDeploymentModule > entry : bdmsByIdentifier . entrySet ( ) ) { final ModuleSpecification bdmSpec = moduleSpecByIdentifier . get ( entry . getKey ( ) ) ; final BeanDeploymentModule bdm = entry . getValue ( ) ; if ( bdm == rootBeanDeploymentModule ) { continue ; } for ( ModuleDependency dependency : bdmSpec . getSystemDependencies ( ) ) { BeanDeploymentModule other = bdmsByIdentifier . get ( dependency . getIdentifier ( ) ) ; if ( ( other != null ) && ( other != bdm ) ) { bdm . addBeanDeploymentModule ( other ) ; } } } final List < Metadata < Extension > > extensions = deploymentUnit . getAttachmentList ( PORTABLE_EXTENSIONS ) ; final WeldDeployment deployment = new WeldDeployment ( beanDeploymentArchives , extensions , module , subDeploymentLoaders ) ; final WeldContainer weldContainer = new WeldContainer ( deployment , Environments . EE_INJECT ) ; final ValidatorFactory factory = deploymentUnit . getAttachment ( VALIDATOR_FACTORY ) ; weldContainer . addWeldService ( ValidationServices . class , new org . jboss . as . weld . services . bootstrap . WeldValidationServices ( factory ) ) ; final EjbInjectionServices ejbInjectionServices = new org . jboss . as . weld . services . bootstrap . WeldEjbInjectionServices ( deploymentUnit . getServiceRegistry ( ) , eeModuleDescription , eeApplicationDescription , deploymentRoot . getRoot ( ) ) ; weldContainer . addWeldService ( EjbInjectionServices . class , ejbInjectionServices ) ; rootBeanDeploymentModule . addService ( EjbInjectionServices . class , ejbInjectionServices ) ; weldContainer . addWeldService ( EjbServices . class , new org . jboss . as . weld . services . bootstrap . WeldEjbServices ( deploymentUnit . getServiceRegistry ( ) ) ) ; final JpaInjectionServices rootJpaInjectionServices = new org . jboss . as . weld . services . bootstrap . WeldJpaInjectionServices ( deploymentUnit , deploymentUnit . getServiceRegistry ( ) ) ; weldContainer . addWeldService ( JpaInjectionServices . class , rootJpaInjectionServices ) ; final WeldService weldService = new WeldService ( weldContainer , deploymentUnit . getName ( ) ) ; final ServiceBuilder < WeldContainer > weldServiceBuilder = serviceTarget . addService ( weldServiceName , weldService ) ; weldServiceBuilder . addDependencies ( TCCLSingletonService . SERVICE_NAME ) ; installResourceInjectionService ( serviceTarget , deploymentUnit , weldService , weldServiceBuilder ) ; installSecurityService ( serviceTarget , deploymentUnit , weldService , weldServiceBuilder ) ; installTransactionService ( serviceTarget , deploymentUnit , weldService , weldServiceBuilder ) ; weldServiceBuilder . addDependencies ( jpaServices ) ; <START_BUG> weldServiceBuilder . addDependency ( JndiNamingDependencyProcessor . serviceName ( deploymentUnit ) ) ; <END_BUG> weldServiceBuilder . install ( ) ; } private void getJpaDependencies ( final DeploymentUnit deploymentUnit , final Set < ServiceName > jpaServices ) { } private ServiceName installSecurityService ( ServiceTarget serviceTarget , DeploymentUnit deploymentUnit , WeldService weldService , ServiceBuilder < WeldContainer > weldServiceBuilder ) { } private ServiceName installResourceInjectionService ( ServiceTarget serviceTarget , DeploymentUnit deploymentUnit , WeldService weldService , ServiceBuilder < WeldContainer > weldServiceBuilder ) { } private ServiceName installTransactionService ( final ServiceTarget serviceTarget , final DeploymentUnit deploymentUnit , WeldService weldService , ServiceBuilder < WeldContainer > weldServiceBuilder ) { } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
weldServiceBuilder . addDependency ( JndiNamingDependencyProcessor . serviceName ( deploymentUnit . getServiceName ( ) ) ) ;