Buggy code:
public abstract class CacheAdd extends AbstractAddStepHandler { private static final Logger log = Logger . getLogger ( CacheAdd . class . getPackage ( ) . getName ( ) ) ; private static final String DEFAULTS = "infinispan-defaults.xml" ; private static volatile Map < CacheMode , Configuration > defaults = null ; public static synchronized Configuration getDefaultConfiguration ( CacheMode cacheMode ) { } private static ConfigurationBuilderHolder load ( String resource ) { } private static URL find ( String resource , ClassLoader ... loaders ) { } final CacheMode mode ; CacheAdd ( CacheMode mode ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } Collection < ServiceController < ? > > installRuntimeServices ( OperationContext context , ModelNode operation , ModelNode containerModel , ModelNode cacheModel , ServiceVerificationHandler verificationHandler ) throws OperationFailedException { } void removeRuntimeServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } protected PathAddress getCacheAddressFromOperation ( ModelNode operation ) { } protected PathAddress getCacheContainerAddressFromOperation ( ModelNode operation ) { } ServiceController < ? > installCacheConfigurationService ( ServiceTarget target , String containerName , String cacheName , String defaultCache , ModuleIdentifier moduleId , ConfigurationBuilder builder , Configuration config , List < CacheAdd . Dependency < ? > > dependencies , ServiceVerificationHandler verificationHandler ) { } ServiceController < ? > installCacheService ( ServiceTarget target , String containerName , String cacheName , String defaultCache , ServiceController . Mode initialMode , Configuration config , ServiceVerificationHandler verificationHandler ) { final InjectedValue < EmbeddedCacheManager > container = new InjectedValue < EmbeddedCacheManager > ( ) ; final CacheAdd . CacheDependencies cacheDependencies = new CacheAdd . CacheDependencies ( container ) ; final Service < Cache < Object , Object > > service = new CacheService < Object , Object > ( cacheName , cacheDependencies ) ; <START_BUG> final ServiceBuilder < ? > builder = target . addService ( CacheService . getServiceName ( containerName , cacheName ) , new org . jboss . as . clustering . msc . AsynchronousService < Cache < Object , Object > > ( service ) ) . addDependency ( CacheConfigurationService . getServiceName ( containerName , cacheName ) ) . addDependency ( EmbeddedCacheManagerService . getServiceName ( containerName ) , EmbeddedCacheManager . class , container ) . addDependency ( ( config . clustering ( ) . cacheMode ( ) . isClustered ( ) ? DependencyType . REQUIRED : DependencyType . OPTIONAL ) , ChannelService . getServiceName ( containerName ) ) . setInitialMode ( initialMode ) ; <END_BUG> if ( config . transaction ( ) . recovery ( ) . enabled ( ) ) { builder . addDependency ( JBOSS_TXN_ARJUNA_RECOVERY_MANAGER , XAResourceRecoveryRegistry . class , cacheDependencies . getRecoveryRegistryInjector ( ) ) ; } if ( cacheName . equals ( defaultCache ) ) { builder . addAliases ( CacheService . getServiceName ( containerName , null ) ) ; } if ( initialMode == ( Mode . ACTIVE ) ) { builder . addListener ( verificationHandler ) ; } return builder . install ( ) ; } @ SuppressWarnings ( "rawtypes" ) ServiceController < ? > installJndiService ( ServiceTarget target , String containerName , String cacheName , String jndiNameString , ServiceVerificationHandler verificationHandler ) { } private < T > void addDependency ( ServiceBuilder < ? > builder , CacheAdd . Dependency < T > dependency ) { } void populate ( ModelNode fromModel , ModelNode toModel ) throws OperationFailedException { } void processModelNode ( OperationContext context , String containerName , ModelNode cache , ConfigurationBuilder builder , List < CacheAdd . Dependency < ? > > dependencies ) throws OperationFailedException { } private String findStoreKey ( ModelNode cache ) { } private ModelNode getStoreModelNode ( ModelNode cache ) { } private void buildCacheStore ( OperationContext context , LoaderConfigurationBuilder builder , String containerName , ModelNode store , String storeKey , List < CacheAdd . Dependency < ? > > dependencies ) throws OperationFailedException { } private CacheStore createJDBCStore ( Properties properties , OperationContext context , ModelNode store ) throws OperationFailedException { } private void setBinaryKeyedTableProperties ( Properties properties , OperationContext context , ModelNode table , String propertySuffix , String tableNamePrefixProperty ) throws OperationFailedException { } private void setStringKeyedTableProperties ( Properties properties , OperationContext context , ModelNode table , String propertySuffix , String tableNamePrefixProperty ) throws OperationFailedException { } private void setTableProperties ( Properties properties , OperationContext context , ModelNode table , String propertySuffix , String tableNamePrefixProperty , String defaultTableNamePrefix ) throws OperationFailedException { } private String getColumnProperty ( ModelNode table , String columnKey , String key , String defaultValue ) { } protected class Dependency < I > { private final ServiceName name ; private final Class < I > type ; private final Injector < I > target ; Dependency ( ServiceName name ) { } Dependency ( ServiceName name , Class < I > type , Injector < I > target ) { } ServiceName getName ( ) { } public Class < I > getType ( ) { } public Injector < I > getInjector ( ) { } } private abstract class SimpleInjector < I > implements Injector < I > { @ Override public void uninject ( ) { } } private static class CacheDependencies implements CacheService . Dependencies { private final Value < EmbeddedCacheManager > container ; private final InjectedValue < XAResourceRecoveryRegistry > recoveryRegistry = new InjectedValue < XAResourceRecoveryRegistry > ( ) ; CacheDependencies ( Value < EmbeddedCacheManager > container ) { } Injector < XAResourceRecoveryRegistry > getRecoveryRegistryInjector ( ) { } @ Override public EmbeddedCacheManager getCacheContainer ( ) { } @ Override public XAResourceRecoveryRegistry getRecoveryRegistry ( ) { } } private static class CacheConfigurationDependencies implements CacheConfigurationService . Dependencies { private final Value < EmbeddedCacheManager > container ; private final InjectedValue < TransactionManager > tm = new InjectedValue < TransactionManager > ( ) ;

Fix:
final ServiceBuilder < ? > builder = AsynchronousService . addService ( target , CacheService . getServiceName ( containerName , cacheName ) , service ) . addDependency ( CacheConfigurationService . getServiceName ( containerName , cacheName ) ) . addDependency ( EmbeddedCacheManagerService . getServiceName ( containerName ) , EmbeddedCacheManager . class , container ) . addDependency ( ( config . clustering ( ) . cacheMode ( ) . isClustered ( ) ? DependencyType . REQUIRED : DependencyType . OPTIONAL ) , ChannelService . getServiceName ( containerName ) ) . setInitialMode ( initialMode ) ;