Buggy code:
public class WarDeploymentProcessor implements DeploymentUnitProcessor { private final String defaultHost ; public WarDeploymentProcessor ( String defaultHost ) { } @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } public static String hostNameOfDeployment ( final WarMetaData metaData , final String defaultHost ) { } @ Override public void undeploy ( final DeploymentUnit context ) { } protected void processDeployment ( final String hostName , final WarMetaData warMetaData , final DeploymentUnit deploymentUnit , final ServiceTarget serviceTarget ) throws DeploymentUnitProcessingException { final VirtualFile deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; if ( module == null ) { throw new DeploymentUnitProcessingException ( ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>resolve<seq2seq4repair_space>module<seq2seq4repair_space>for<seq2seq4repair_space>deployment<seq2seq4repair_space>" + deploymentRoot ) ) ; } final ClassLoader classLoader = module . getClassLoader ( ) ; final JBossWebMetaData metaData = warMetaData . getMergedJBossWebMetaData ( ) ; <START_BUG> final List < SetupAction > setupActions = deploymentUnit . getAttachmentList ( EE_SETUP_ACTIONS ) ; <END_BUG> final StandardContext webContext = new StandardContext ( ) ; final JBossContextConfig config = new JBossContextConfig ( deploymentUnit ) ; webContext . addValve ( new org . jboss . as . web . security . SecurityContextAssociationValve ( deploymentUnit ) ) ; List < ValveMetaData > valves = metaData . getValves ( ) ; if ( valves == null ) { metaData . setValves ( ( valves = new ArrayList < ValveMetaData > ( ) ) ) ; } try { webContext . setDocBase ( deploymentRoot . getPhysicalFile ( ) . getAbsolutePath ( ) ) ; } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( e ) ; } webContext . addLifecycleListener ( config ) ; final String pathName = WarDeploymentProcessor . pathNameOfDeployment ( deploymentUnit , metaData ) ; webContext . setPath ( pathName ) ; webContext . setIgnoreAnnotations ( true ) ; webContext . setCrossContext ( ( ! ( metaData . isDisableCrossContext ( ) ) ) ) ; final WebInjectionContainer injectionContainer = new WebInjectionContainer ( module . getClassLoader ( ) ) ; final Map < String , ComponentInstantiator > components = deploymentUnit . getAttachment ( WEB_COMPONENT_INSTANTIATORS ) ; if ( components != null ) { final Set < ServiceName > failed = deploymentUnit . getAttachment ( FAILED_COMPONENTS ) ; for ( Map . Entry < String , ComponentInstantiator > entry : components . entrySet ( ) ) { boolean skip = false ; for ( final ServiceName serviceName : entry . getValue ( ) . getServiceNames ( ) ) { if ( failed . contains ( serviceName ) ) { skip = true ; break ; } } if ( ! skip ) { injectionContainer . addInstantiator ( entry . getKey ( ) , entry . getValue ( ) ) ; } } } webContext . setInstanceManager ( injectionContainer ) ; final Loader loader = new WebCtxLoader ( classLoader ) ; webContext . setLoader ( loader ) ; switch ( metaData . getSessionCookies ( ) ) { case JBossWebMetaData . SESSION_COOKIES_ENABLED : webContext . setCookies ( true ) ; break ; case JBossWebMetaData . SESSION_COOKIES_DISABLED : webContext . setCookies ( false ) ; break ; } String metaDataSecurityDomain = metaData . getSecurityDomain ( ) ; if ( metaDataSecurityDomain != null ) { metaDataSecurityDomain = metaDataSecurityDomain . trim ( ) ; } String securityDomain = ( metaDataSecurityDomain == null ) ? SecurityConstants . DEFAULT_APPLICATION_POLICY : SecurityUtil . unprefixSecurityDomain ( metaDataSecurityDomain ) ; final List < ServletContextAttribute > attributes = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; if ( attributes != null ) { final ServletContext context = webContext . getServletContext ( ) ; for ( ServletContextAttribute attribute : attributes ) { context . setAttribute ( attribute . getName ( ) , attribute . getValue ( ) ) ; } } try { final ServiceName deploymentServiceName = WebSubsystemServices . deploymentServiceName ( hostName , pathName ) ; final ServiceName realmServiceName = deploymentServiceName . append ( "realm" ) ; final JBossWebRealmService realmService = new JBossWebRealmService ( deploymentUnit ) ; ServiceBuilder < ? > builder = serviceTarget . addService ( realmServiceName , realmService ) ; builder . addDependency ( REQUIRED , SERVICE_NAME . append ( securityDomain ) , SecurityDomainContext . class , realmService . getSecurityDomainContextInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; final WebDeploymentService webDeploymentService = new WebDeploymentService ( webContext , injectionContainer , setupActions ) ; builder = serviceTarget . addService ( deploymentServiceName , webDeploymentService ) . addDependency ( JBOSS_WEB_HOST . append ( hostName ) , VirtualHost . class , new WebContextInjector ( webContext ) ) . addDependencies ( injectionContainer . getServiceNames ( ) ) . addDependency ( realmServiceName , Realm . class , webDeploymentService . getRealm ( ) ) . addDependencies ( deploymentUnit . getAttachmentList ( WEB_DEPENDENCIES ) ) . addDependency ( JndiNamingDependencyProcessor . serviceName ( deploymentUnit ) ) ; for ( final SetupAction action : setupActions ) { builder . addDependencies ( action . dependencies ( ) ) ; } if ( ( metaData . getDistributable ( ) ) != null ) { DistributedCacheManagerFactoryService factoryService = new DistributedCacheManagerFactoryService ( ) ; DistributedCacheManagerFactory factory = factoryService . getValue ( ) ; if ( factory != null ) { ServiceName factoryServiceName = deploymentServiceName . append ( "session" ) ; builder . addDependency ( OPTIONAL , factoryServiceName , DistributedCacheManagerFactory . class , config . getDistributedCacheManagerFactoryInjector ( ) ) ; ServiceBuilder < DistributedCacheManagerFactory > factoryBuilder = serviceTarget . addService ( factoryServiceName , factoryService ) ; boolean enabled = factory . addDependencies ( serviceTarget , factoryBuilder , metaData ) ; factoryBuilder . setInitialMode ( ( enabled ? Mode . ON_DEMAND : Mode . NEVER ) ) . install ( ) ; } } builder . install ( ) ; AbstractSecurityDeployer < ? > deployer = new WarSecurityDeployer ( ) ; JaccService < ? > service = deployer . deploy ( deploymentUnit ) ; if ( service != null ) { ( ( WarJaccService ) ( service ) ) . setContext ( webContext ) ;

Fix:
final List < SetupAction > setupActions = deploymentUnit . getAttachmentList ( WEB_SETUP_ACTIONS ) ;