Buggy code:
public class JBossContextConfig extends ContextConfig { private static Logger log = Logger . getLogger ( JBossContextConfig . class ) ; private DeploymentUnit deploymentUnitContext = null ; private Set < String > overlays = new HashSet < String > ( ) ; private final InjectedValue < DistributedCacheManagerFactory > factory = new InjectedValue < DistributedCacheManagerFactory > ( ) ; public JBossContextConfig ( DeploymentUnit deploymentUnitContext ) { } @ Override public void lifecycleEvent ( LifecycleEvent event ) { } @ Override protected void applicationWebConfig ( ) { } @ Override protected void defaultWebConfig ( ) { } protected void processJBossWebMetaData ( JBossWebMetaData metaData ) { } protected Object getInstance ( String moduleName , String className , List < ParamValueMetaData > params ) { } protected void processWebMetaData ( JBossWebMetaData metaData ) { if ( ( context ) instanceof StandardContext ) { ( ( StandardContext ) ( context ) ) . setReplaceWelcomeFiles ( true ) ; } context . setVersion ( metaData . getVersion ( ) ) ; if ( metaData . is30 ( ) ) context . setPublicId ( "//javax//servlet//resources//web-app_3_0.dtd" ) ; else if ( metaData . is25 ( ) ) context . setPublicId ( "//javax//servlet//resources//web-app_2_5.dtd" ) ; else if ( metaData . is24 ( ) ) context . setPublicId ( "//javax//servlet//resources//web-app_2_4.dtd" ) ; else if ( metaData . is23 ( ) ) context . setPublicId ( WebDtdPublicId_23 ) ; else context . setPublicId ( WebDtdPublicId_22 ) ; DescriptionGroupMetaData dg = metaData . getDescriptionGroup ( ) ; if ( dg != null ) { String displayName = dg . getDisplayName ( ) ; if ( displayName != null ) { context . setDisplayName ( displayName ) ; } } if ( ( metaData . getDistributable ( ) ) != null ) { try { <START_BUG> context . setManager ( new org . jboss . as . web . session . DistributableSessionManager < org . jboss . as . clustering . web . OutgoingDistributableSessionData > ( this . factory . getOptionalValue ( ) , this . context . getParent ( ) , metaData ) ) ; <END_BUG> context . setDistributable ( true ) ; } catch ( Exception e ) { WEB_LOGGER . clusteringNotSupported ( ) ; } } List < ParamValueMetaData > contextParams = metaData . getContextParams ( ) ; if ( contextParams != null ) { for ( ParamValueMetaData param : contextParams ) { context . addParameter ( param . getParamName ( ) , param . getParamValue ( ) ) ; } } List < ErrorPageMetaData > errorPages = metaData . getErrorPages ( ) ; if ( errorPages != null ) { for ( ErrorPageMetaData value : errorPages ) { ErrorPage errorPage = new ErrorPage ( ) ; errorPage . setErrorCode ( value . getErrorCode ( ) ) ; errorPage . setExceptionType ( value . getExceptionType ( ) ) ; errorPage . setLocation ( value . getLocation ( ) ) ; context . addErrorPage ( errorPage ) ; } } FiltersMetaData filters = metaData . getFilters ( ) ; if ( filters != null ) { for ( FilterMetaData value : filters ) { FilterDef filterDef = new FilterDef ( ) ; filterDef . setFilterName ( value . getName ( ) ) ; filterDef . setFilterClass ( value . getFilterClass ( ) ) ; if ( ( value . getInitParam ( ) ) != null ) for ( ParamValueMetaData param : value . getInitParam ( ) ) { filterDef . addInitParameter ( param . getParamName ( ) , param . getParamValue ( ) ) ; } filterDef . setAsyncSupported ( value . isAsyncSupported ( ) ) ; context . addFilterDef ( filterDef ) ; } } List < FilterMappingMetaData > filtersMappings = metaData . getFilterMappings ( ) ; if ( filtersMappings != null ) { for ( FilterMappingMetaData value : filtersMappings ) { FilterMap filterMap = new FilterMap ( ) ; filterMap . setFilterName ( value . getFilterName ( ) ) ; List < String > servletNames = value . getServletNames ( ) ; if ( servletNames != null ) { for ( String name : servletNames ) filterMap . addServletName ( name ) ; } List < String > urlPatterns = value . getUrlPatterns ( ) ; if ( urlPatterns != null ) { for ( String pattern : urlPatterns ) filterMap . addURLPattern ( pattern ) ; } List < DispatcherType > dispatchers = value . getDispatchers ( ) ; if ( dispatchers != null ) { for ( DispatcherType type : dispatchers ) filterMap . setDispatcher ( type . name ( ) ) ; } context . addFilterMap ( filterMap ) ; } } List < ListenerMetaData > listeners = metaData . getListeners ( ) ; if ( listeners != null ) { for ( ListenerMetaData value : listeners ) { context . addApplicationListener ( value . getListenerClass ( ) ) ; } } LoginConfigMetaData loginConfig = metaData . getLoginConfig ( ) ; if ( loginConfig != null ) { LoginConfig loginConfig2 = new LoginConfig ( ) ; loginConfig2 . setAuthMethod ( loginConfig . getAuthMethod ( ) ) ; loginConfig2 . setRealmName ( loginConfig . getRealmName ( ) ) ; if ( ( loginConfig . getFormLoginConfig ( ) ) != null ) { loginConfig2 . setLoginPage ( loginConfig . getFormLoginConfig ( ) . getLoginPage ( ) ) ; loginConfig2 . setErrorPage ( loginConfig . getFormLoginConfig ( ) . getErrorPage ( ) ) ; } context . setLoginConfig ( loginConfig2 ) ; } List < MimeMappingMetaData > mimes = metaData . getMimeMappings ( ) ; if ( mimes != null ) { for ( MimeMappingMetaData value : mimes ) { context . addMimeMapping ( value . getExtension ( ) , value . getMimeType ( ) ) ; } } List < SecurityConstraintMetaData > scs = metaData . getSecurityConstraints ( ) ; if ( scs != null ) { for ( SecurityConstraintMetaData value : scs ) { SecurityConstraint constraint = new SecurityConstraint ( ) ; TransportGuaranteeType tg = value . getTransportGuarantee ( ) ;

Fix:
context . setManager ( new org . jboss . as . web . session . DistributableSessionManager < org . jboss . as . clustering . web . OutgoingDistributableSessionData > ( this . factory . getOptionalValue ( ) , this . context , metaData ) ) ;