Buggy code:
public class BeanArchiveProcessor implements DeploymentUnitProcessor { private static final Logger log = Logger . getLogger ( "org.jboss.weld" ) ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final DeploymentUnit topLevelDeployment = ( ( deploymentUnit . getParent ( ) ) == null ) ? deploymentUnit : deploymentUnit . getParent ( ) ; final WeldDeploymentMetadata cdiDeploymentMetadata = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; <START_BUG> if ( ! ( WeldDeploymentMarker . isWeldDeployment ( deploymentUnit ) ) ) { <END_BUG> return ; } EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final Module topLevelModule = topLevelDeployment . getAttachment ( MODULE ) ; if ( eeModuleDescription != null ) { eeModuleDescription . addInjectionFactory ( new org . jboss . as . weld . injection . WeldInjectionFactory ( phaseContext . getServiceTarget ( ) , deploymentUnit , topLevelModule . getClassLoader ( ) ) ) ; } final String beanArchiveIdPrefix ; if ( ( deploymentUnit . getParent ( ) ) == null ) { beanArchiveIdPrefix = deploymentUnit . getName ( ) ; } else { beanArchiveIdPrefix = ( ( deploymentUnit . getParent ( ) . getName ( ) ) + "." ) + ( deploymentUnit . getName ( ) ) ; } final Set < BeanDeploymentArchiveImpl > beanDeploymentArchives = new HashSet < BeanDeploymentArchiveImpl > ( ) ; BeanArchiveProcessor . log . info ( ( "Processing<seq2seq4repair_space>CDI<seq2seq4repair_space>deployment:<seq2seq4repair_space>" + ( phaseContext . getDeploymentUnit ( ) . getName ( ) ) ) ) ; final Map < ResourceRoot , Index > indexes = AnnotationIndexUtils . getAnnotationIndexes ( deploymentUnit ) ; final Map < ResourceRoot , BeanDeploymentArchiveImpl > bdaMap = new HashMap < ResourceRoot , BeanDeploymentArchiveImpl > ( ) ; final Module module = phaseContext . getDeploymentUnit ( ) . getAttachment ( MODULE ) ; BeanDeploymentArchiveImpl rootBda = null ; if ( cdiDeploymentMetadata != null ) { for ( BeanArchiveMetadata beanArchiveMetadata : cdiDeploymentMetadata . getBeanArchiveMetadata ( ) ) { BeanDeploymentArchiveImpl bda = createBeanDeploymentArchive ( indexes . get ( beanArchiveMetadata . getResourceRoot ( ) ) , beanArchiveMetadata , module , beanArchiveIdPrefix ) ; beanDeploymentArchives . add ( bda ) ; bdaMap . put ( beanArchiveMetadata . getResourceRoot ( ) , bda ) ; if ( beanArchiveMetadata . isDeploymentRoot ( ) ) { rootBda = bda ; deploymentUnit . putAttachment ( DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE , bda ) ; } } } if ( rootBda == null ) { BeanDeploymentArchiveImpl bda = new BeanDeploymentArchiveImpl ( Collections . < String > emptySet ( ) , BeansXml . EMPTY_BEANS_XML , module , beanArchiveIdPrefix ) ; beanDeploymentArchives . add ( bda ) ; deploymentUnit . putAttachment ( DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE , bda ) ; rootBda = bda ; } processEjbComponents ( deploymentUnit , bdaMap , rootBda , indexes ) ; final EjbInjectionServices ejbInjectionServices = new org . jboss . as . weld . services . bootstrap . WeldEjbInjectionServices ( deploymentUnit . getServiceRegistry ( ) , eeModuleDescription ) ; final JpaInjectionServices jpaInjectionServices = new org . jboss . as . weld . services . bootstrap . WeldJpaInjectionServices ( deploymentUnit , deploymentUnit . getServiceRegistry ( ) ) ; final BeanDeploymentModule bdm = new BeanDeploymentModule ( beanDeploymentArchives ) ; bdm . addService ( EjbInjectionServices . class , ejbInjectionServices ) ; bdm . addService ( JpaInjectionServices . class , jpaInjectionServices ) ; deploymentUnit . putAttachment ( BEAN_DEPLOYMENT_MODULE , bdm ) ; } private void processEjbComponents ( DeploymentUnit deploymentUnit , Map < ResourceRoot , BeanDeploymentArchiveImpl > bdaMap , BeanDeploymentArchiveImpl rootBda , Map < ResourceRoot , Index > indexes ) { } private BeanDeploymentArchiveImpl resolveSessionBeanBda ( String ejbClassName , Map < ResourceRoot , BeanDeploymentArchiveImpl > bdaMap , BeanDeploymentArchiveImpl rootBda , Map < ResourceRoot , Index > indexes ) { } private BeanDeploymentArchiveImpl createBeanDeploymentArchive ( final Index index , BeanArchiveMetadata beanArchiveMetadata , Module module , String beanArchivePrefix ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
if ( ! ( WeldDeploymentMarker . isPartOfWeldDeployment ( deploymentUnit ) ) ) {