Buggy code:
@ SuppressWarnings ( "rawtypes" ) public class InfinispanBeanManagerFactory < G , I , T > extends AbstractService < BeanManagerFactory < G , I , T > > implements BeanManagerFactory < G , I , T > { public static < G , I , T > ServiceBuilder < BeanManagerFactory < G , I , T > > build ( String name , ServiceTarget target , ServiceName serviceName , BeanManagerFactoryBuilderConfiguration config , BeanContext context ) { } private final BeanContext context ; private final CacheInvoker invoker = new RetryingCacheInvoker ( 10 , 100 ) ; private final InjectedValue < Cache > cache = new InjectedValue ( ) ; private final InjectedValue < KeyAffinityServiceFactory > affinityFactory = new InjectedValue ( ) ; private final InjectedValue < VersionedMarshallingConfiguration > config = new InjectedValue ( ) ; private final InjectedValue < ScheduledExecutorService > scheduler = new InjectedValue ( ) ; private final InjectedValue < Executor > executor = new InjectedValue ( ) ; private final BeanPassivationConfiguration passivationConfig ; private final InjectedValue < NodeFactory > nodeFactory = new InjectedValue ( ) ; private final InjectedValue < Registry > registry = new InjectedValue ( ) ; private final InjectedValue < CommandDispatcherFactory > dispatcherFactory = new InjectedValue ( ) ; private InfinispanBeanManagerFactory ( BeanContext context , BeanPassivationConfiguration passivationConfig ) { } @ Override public BeanManager < G , I , T > createBeanManager ( final IdentifierFactory < G > groupIdentifierFactory , final IdentifierFactory < I > beanIdentifierFactory , final PassivationListener < T > passivationListener , final RemoveListener < T > removeListener ) { MarshallingContext context = new SimpleMarshallingContextFactory ( ) . createMarshallingContext ( this . config . getValue ( ) , this . context . getClassLoader ( ) ) ; MarshalledValueFactory < MarshallingContext > factory = new org . jboss . as . clustering . marshalling . SimpleMarshalledValueFactory ( context ) ; Cache < G , BeanGroupEntry < I , T > > groupCache = this . cache . getValue ( ) ; Configuration config = groupCache . getCacheConfiguration ( ) ; BeanGroupFactory < G , I , T > groupFactory = new org . wildfly . clustering . ejb . infinispan . group . InfinispanBeanGroupFactory ( groupCache , this . invoker , factory , context ) ; Configuration < G , G , BeanGroupEntry < I , T > , BeanGroupFactory < G , I , T > > groupConfiguration = new InfinispanBeanManagerFactory . SimpleConfiguration ( groupCache , groupFactory , groupIdentifierFactory ) ; Cache < BeanKey < I > , BeanEntry < G > > beanCache = this . cache . getValue ( ) ; <START_BUG> final String beanName = this . context . getBeanClass ( ) . getName ( ) ; <END_BUG> final boolean evictionAllowed = config . persistence ( ) . usingStores ( ) ; final boolean passivationEnabled = evictionAllowed && ( config . persistence ( ) . passivation ( ) ) ; final boolean persistent = ( config . clustering ( ) . cacheMode ( ) . isClustered ( ) ) || ( evictionAllowed && ( ! passivationEnabled ) ) ; BeanFactory < G , I , T > beanFactory = new org . wildfly . clustering . ejb . infinispan . bean . InfinispanBeanFactory ( beanName , groupFactory , beanCache , this . invoker , this . context . getTimeout ( ) , ( persistent ? passivationListener : null ) ) ; Configuration < I , BeanKey < I > , BeanEntry < G > , BeanFactory < G , I , T > > beanConfiguration = new InfinispanBeanManagerFactory . SimpleConfiguration ( beanCache , beanFactory , beanIdentifierFactory ) ; final NodeFactory < Address > nodeFactory = this . nodeFactory . getValue ( ) ; final Registry < String , ? > registry = this . registry . getValue ( ) ; final KeyAffinityServiceFactory affinityFactory = this . affinityFactory . getValue ( ) ; final CommandDispatcherFactory dispatcherFactory = this . dispatcherFactory . getValue ( ) ; final Time timeout = this . context . getTimeout ( ) ; final ScheduledExecutorService scheduler = this . scheduler . getValue ( ) ; final ExpirationConfiguration < T > expiration = new ExpirationConfiguration < T > ( ) { @ Override public Time getTimeout ( ) { return timeout ; } @ Override public RemoveListener < T > getRemoveListener ( ) { return removeListener ; } @ Override public ScheduledExecutorService getExecutor ( ) { return scheduler ; } } ; final Executor executor = this . executor . getValue ( ) ; final BeanPassivationConfiguration passivationConfig = this . passivationConfig ; final PassivationConfiguration < T > passivation = new PassivationConfiguration < T > ( ) { @ Override public PassivationListener < T > getPassivationListener ( ) { return passivationListener ; } @ Override public boolean isEvictionAllowed ( ) { return evictionAllowed ; } @ Override public boolean isPersistent ( ) { return persistent ; } @ Override public BeanPassivationConfiguration getConfiguration ( ) { return passivationConfig ; } @ Override public Executor getExecutor ( ) { return executor ; } } ; InfinispanBeanManagerConfiguration < T > configuration = new InfinispanBeanManagerConfiguration < T > ( ) { @ Override public String getBeanName ( ) { return beanName ; } @ Override public KeyAffinityServiceFactory getAffinityFactory ( ) { return affinityFactory ; } @ Override public Registry < String , ? > getRegistry ( ) { return registry ; } @ Override public NodeFactory < Address > getNodeFactory ( ) { return nodeFactory ; } @ Override public CommandDispatcherFactory getCommandDispatcherFactory ( ) { return dispatcherFactory ; } @ Override public ExpirationConfiguration < T > getExpirationConfiguration ( ) { return expiration ; } @ Override public PassivationConfiguration < T > getPassivationConfiguration ( ) { return passivation ; } } ; return new InfinispanBeanManager ( configuration , beanConfiguration , groupConfiguration ) ; } @ Override public BeanManagerFactory < G , I , T > getValue ( ) { }

Fix:
final String beanName = this . context . getBeanName ( ) ;