Buggy code:
PathAddress containerAddress = cacheAddress . subAddress ( 0 , ( ( cacheAddress . size ( ) ) - 1 ) ) ; String cacheName = cacheAddress . getLastElement ( ) . getValue ( ) ; String containerName = containerAddress . getLastElement ( ) . getValue ( ) ; ServiceName containerServiceName = EmbeddedCacheManagerService . getServiceName ( containerName ) ; ServiceName cacheServiceName = containerServiceName . append ( cacheName ) ; ServiceName cacheConfigurationServiceName = CacheConfigurationService . getServiceName ( containerName , cacheName ) ; Resource rootResource = context . getRootResource ( ) ; ModelNode container = rootResource . navigate ( containerAddress ) . getModel ( ) ; String defaultCache = container . require ( DEFAULT_CACHE ) . asString ( ) ; ServiceController . Mode initialMode = ( model . hasDefined ( START ) ) ? StartMode . valueOf ( model . get ( START ) . asString ( ) ) . getMode ( ) : Mode . ON_DEMAND ; ServiceTarget target = context . getServiceTarget ( ) ; InjectedValue < EmbeddedCacheManager > containerInjection = new InjectedValue < EmbeddedCacheManager > ( ) ; CacheAdd . CacheConfigurationDependencies cacheConfigurationDependencies = new CacheAdd . CacheConfigurationDependencies ( containerInjection ) ; CacheConfigurationService cacheConfigurationService = new CacheConfigurationService ( cacheName , builder , cacheConfigurationDependencies ) ; ServiceBuilder < Configuration > configBuilder = target . addService ( cacheConfigurationServiceName , cacheConfigurationService ) . addDependency ( containerServiceName , EmbeddedCacheManager . class , containerInjection ) . setInitialMode ( PASSIVE ) ; Configuration config = builder . build ( ) ; if ( config . invocationBatching ( ) . enabled ( ) ) { cacheConfigurationDependencies . getTransactionManagerInjector ( ) . inject ( BatchModeTransactionManager . getInstance ( ) ) ; } else if ( ( config . transaction ( ) . transactionMode ( ) ) == ( TransactionMode . TRANSACTIONAL ) ) { configBuilder . addDependency ( JBOSS_TXN_TRANSACTION_MANAGER , TransactionManager . class , cacheConfigurationDependencies . getTransactionManagerInjector ( ) ) ; if ( config . transaction ( ) . useSynchronization ( ) ) { configBuilder . addDependency ( JBOSS_TXN_SYNCHRONIZATION_REGISTRY , TransactionSynchronizationRegistry . class , cacheConfigurationDependencies . getTransactionSynchronizationRegistryInjector ( ) ) ; } } for ( CacheAdd . Dependency < ? > dependency : dependencies ) { this . addDependency ( configBuilder , dependency ) ; } if ( cacheName . equals ( defaultCache ) ) { configBuilder . addAliases ( CacheConfigurationService . getServiceName ( containerName , null ) ) ; } newControllers . add ( configBuilder . install ( ) ) ; CacheAdd . log . debugf ( "Cache<seq2seq4repair_space>configuration<seq2seq4repair_space>service<seq2seq4repair_space>for<seq2seq4repair_space>%s<seq2seq4repair_space>installed<seq2seq4repair_space>for<seq2seq4repair_space>container<seq2seq4repair_space>%s" , cacheName , containerName ) ; CacheAdd . CacheDependencies cacheDependencies = new CacheAdd . CacheDependencies ( containerInjection ) ; CacheService < Object , Object > cacheService = new CacheService < Object , Object > ( cacheName , cacheDependencies ) ; ServiceBuilder < Cache < Object , Object > > cacheBuilder = target . addService ( cacheServiceName , cacheService ) . addDependency ( cacheConfigurationServiceName ) . setInitialMode ( initialMode ) ; if ( config . transaction ( ) . recovery ( ) . enabled ( ) ) { cacheBuilder . addDependency ( JBOSS_TXN_ARJUNA_RECOVERY_MANAGER , XAResourceRecoveryRegistry . class , cacheDependencies . getRecoveryRegistryInjector ( ) ) ; } if ( cacheName . equals ( defaultCache ) ) { cacheBuilder . addAliases ( CacheService . getServiceName ( containerName , null ) ) ; } if ( initialMode == ( Mode . ACTIVE ) ) { cacheBuilder . addListener ( verificationHandler ) ; } newControllers . add ( cacheBuilder . install ( ) ) ; String jndiName = ( model . hasDefined ( JNDI_NAME ) ? InfinispanJndiName . toJndiName ( model . get ( JNDI_NAME ) . asString ( ) ) : InfinispanJndiName . defaultCacheJndiName ( containerName , cacheName ) ) . getAbsoluteName ( ) ; ContextNames . BindInfo bindInfo = ContextNames . bindInfoFor ( jndiName ) ; BinderService binder = new BinderService ( bindInfo . getBindName ( ) ) ; @ SuppressWarnings ( "rawtypes" ) <START_BUG> ServiceBuilder < ManagedReferenceFactory > binderBuilder = target . addService ( bindInfo . getBinderServiceName ( ) , binder ) . addAliases ( JAVA_CONTEXT_SERVICE_NAME . append ( jndiName ) ) . addDependency ( cacheServiceName , Cache . class , new org . jboss . as . naming . ManagedReferenceInjector < Cache > ( binder . getManagedObjectInjector ( ) ) ) . addDependency ( bindInfo . getParentContextServiceName ( ) , ServiceBasedNamingStore . class , binder . getNamingStoreInjector ( ) ) . setInitialMode ( initialMode ) ; <END_BUG> newControllers . add ( binderBuilder . install ( ) ) ; CacheAdd . log . debugf ( "Cache<seq2seq4repair_space>service<seq2seq4repair_space>for<seq2seq4repair_space>cache<seq2seq4repair_space>%s<seq2seq4repair_space>installed<seq2seq4repair_space>for<seq2seq4repair_space>container<seq2seq4repair_space>%s" , cacheName , containerName ) ; } private < T > void addDependency ( ServiceBuilder < ? > builder , CacheAdd . Dependency < T > dependency ) { } abstract void populateCacheMode ( ModelNode fromModel , ModelNode toModel ) throws OperationFailedException { } void populate ( ModelNode fromModel , ModelNode toModel ) { } void processModelNode ( ModelNode cache , ConfigurationBuilder builder , List < CacheAdd . Dependency < ? > > dependencies ) { } private String findStoreKey ( ModelNode cache ) { } private ModelNode getStoreModelNode ( ModelNode cache ) { } private void buildCacheStore ( LoaderConfigurationBuilder builder , String name , ModelNode store , String storeKey , List < CacheAdd . Dependency < ? > > dependencies ) { } private CacheStore createJDBCStore ( Properties properties , ModelNode store ) { } private void setBucketTableProperties ( Properties properties , ModelNode table , String propertySuffix ) { } private void setEntryTableProperties ( Properties properties , ModelNode table , String propertySuffix ) { } private void setTableProperties ( Properties properties , ModelNode table , String propertySuffix , String defaultTableNamePrefix ) { } 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 ) { }

Fix:
ServiceBuilder < ManagedReferenceFactory > binderBuilder = target . addService ( bindInfo . getBinderServiceName ( ) , binder ) . addAliases ( JAVA_CONTEXT_SERVICE_NAME . append ( jndiName ) ) . addDependency ( cacheServiceName , Cache . class , new org . jboss . as . naming . ManagedReferenceInjector < Cache > ( binder . getManagedObjectInjector ( ) ) ) . addDependency ( bindInfo . getParentContextServiceName ( ) , ServiceBasedNamingStore . class , binder . getNamingStoreInjector ( ) ) . setInitialMode ( PASSIVE ) ;