Buggy code:
public class WarDeploymentProcessor implements DeploymentUnitProcessor { private final String defaultHost ; private final WebServerService service ; public WarDeploymentProcessor ( String defaultHost , WebServerService service ) { } public WarDeploymentProcessor ( String defaultHost ) { } @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } static String hostNameOfDeployment ( final WarMetaData metaData , final String defaultHost ) { } @ Override public void undeploy ( final DeploymentUnit context ) { } private 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 ( WebMessages . MESSAGES . failedToResolveModule ( deploymentRoot ) ) ; } final ClassLoader classLoader = module . getClassLoader ( ) ; final JBossWebMetaData metaData = warMetaData . getMergedJBossWebMetaData ( ) ; final List < SetupAction > setupActions = deploymentUnit . getAttachmentList ( WEB_SETUP_ACTIONS ) ; WebContextFactory contextFactory = deploymentUnit . getAttachment ( ATTACHMENT ) ; if ( contextFactory == null ) { contextFactory = WebContextFactory . DEFAULT ; } final StandardContext webContext = contextFactory . createContext ( deploymentUnit ) ; final JBossContextConfig config = new JBossContextConfig ( deploymentUnit , this . service ) ; webContext . addValve ( new org . jboss . as . web . security . SecurityContextAssociationValve ( deploymentUnit ) ) ; 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 ( ) ) ) ) ; contextFactory . postProcessContext ( deploymentUnit , webContext ) ; 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 ( ) ) ; } } } final Loader loader = new WebCtxLoader ( classLoader ) ; webContext . setLoader ( loader ) ; <START_BUG> webContext . setAllowLinking ( metaData . getSymbolicLinking ( ) ) ; <END_BUG> List < ValveMetaData > valves = metaData . getValves ( ) ; if ( valves == null ) { metaData . setValves ( ( valves = new ArrayList < ValveMetaData > ( ) ) ) ; } for ( ValveMetaData valve : valves ) { Valve valveInstance = ( ( Valve ) ( getInstance ( module , valve . getModule ( ) , valve . getValveClass ( ) , valve . getParams ( ) ) ) ) ; webContext . getPipeline ( ) . addValve ( valveInstance ) ; } List < ContainerListenerMetaData > listeners = metaData . getContainerListeners ( ) ; if ( listeners != null ) { for ( ContainerListenerMetaData listener : listeners ) { switch ( listener . getListenerType ( ) ) { case CONTAINER : ContainerListener containerListener = ( ( ContainerListener ) ( getInstance ( module , listener . getModule ( ) , listener . getListenerClass ( ) , listener . getParams ( ) ) ) ) ; webContext . addContainerListener ( containerListener ) ; break ; case LIFECYCLE : LifecycleListener lifecycleListener = ( ( LifecycleListener ) ( getInstance ( module , listener . getModule ( ) , listener . getListenerClass ( ) , listener . getParams ( ) ) ) ) ; if ( webContext instanceof Lifecycle ) { ( ( Lifecycle ) ( webContext ) ) . addLifecycleListener ( lifecycleListener ) ; } break ; case SERVLET_INSTANCE : webContext . addInstanceListener ( listener . getListenerClass ( ) ) ; break ; case SERVLET_CONTAINER : webContext . addWrapperListener ( listener . getListenerClass ( ) ) ; break ; case SERVLET_LIFECYCLE : webContext . addWrapperLifecycle ( listener . getListenerClass ( ) ) ; break ; } } } 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 = getJBossAppSecurityDomain ( deploymentUnit ) ; } 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 ) ; try { final ServiceName webappServiceName = WebSubsystemServices . deploymentServiceName ( hostName , pathName ) ; final ServiceName realmServiceName = webappServiceName . append ( "realm" ) ; deploymentUnit . addToAttachmentList ( DEPLOYMENT_COMPLETE_SERVICES , webappServiceName ) ; deploymentUnit . addToAttachmentList ( DEPLOYMENT_COMPLETE_SERVICES , realmServiceName ) ; final JBossWebRealmService realmService = new JBossWebRealmService ( deploymentUnit ) ; ServiceBuilder < Realm > realmBuilder = serviceTarget . addService ( realmServiceName , realmService ) ;

Fix:
webContext . setAllowLinking ( metaData . isSymbolicLinkingEnabled ( ) ) ;