4 Replies Latest reply on Feb 1, 2020 7:52 PM by brianwang17

    Fail to start custom cache container, in Infinispan Cluster

    brianwang17

      Hello,

      I am currently in the beginning stages of learning the ropes with JBOSS and trying to fix an issue with a HA system (Full-HA). I've been tackling at it as much as I could for the past 2 months, but can't seem to progress any further. I'm still super new at Infinispan, let alone JBOSS in general. The error I am getting is regarding a custom cache container; in the second log listed below, it's stating that the member caches for it are failing, because the cache configurations for it don't exist. I already read a previous forum of somebody having a similar issue with solution, Wildfly 12 Cache migration error , but after trying the solution which was to add a <resource-ref> to the ejb-jar.xml, I kept getting this error:

       

      ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "Application.ear")]) - failure description: {"WFLYCTL0080: Failed services" =>
      {"jboss.deployment.subunit.\"Application.ear\".\"MyCacheContainer.jar\".component.MyCacheContainerBean.START" => "java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
          Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
          Caused by: javax.ejb.EJBException: org.infinispan.commons.CacheConfigurationException: ISPN000436: Cache 'my-cache' has been requested, but no cache configuration exists with that name and no default cache has been set for this container
          Caused by: org.infinispan.commons.CacheConfigurationException: ISPN000436: Cache 'util-map' has been requested, but no cache configuration exists with that name and no default cache has been set for this container"}}
      INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
      WFLYCTL0186:   Services which failed to start:      service jboss.deployment.subunit."Application.ear"."MyCacheContainer.jar".component.MyCacheContainerBean.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
      WFLYCTL0448: 1 additional services are down due to their dependencies being missing or failed 

       

      If anyone can help me get this working, I would be very appreciative of it. How I understand it is that JBOSS is trying to pull configurations from my app server configurations file, and use them for the application I am trying to run, but the app server settings are not being written into the JNDI Tree (see below for JNDI Tree) when the app server is first starting up, and thus no configurations for my cache container exist to be pulled, hence returning "no cache configurations exist". Please correct me if I'm wrong, I would love to properly learn how all this works. For use, I have posted a bunch of settings after the log right under.

       

       

      ######################################################################################

      Original Log before trying the fix from Wildfly 12 Cache migration error :

      INFO  [com.?.configuration.ejb.ConfigurationManagerBean] (ServerService Thread Pool -- 83) Initialized class com.?.configuration.ejb.ConfigurationManagerBean
      ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 88) MSC000001: Failed to start service jboss.deployment.subunit."Application.ear"."MyCacheContainer".component.MyCacheContainerBean.START: org.jboss.msc.service.StartException in 
      service jboss.deployment.subunit."Application.ear"."MyCacheContainer.jar".component.MyCacheContainerBean.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
              at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_191]
              at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_191]
              at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
              at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
              at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_191]
              at org.jboss.threads.JBossThread.run(JBossThread.java:485)
      Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:127)
              at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:141)
              at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              ... 8 more
      Caused by: javax.ejb.EJBException: org.infinispan.commons.CacheConfigurationException: ISPN000436: Cache 'my-cache' has been requested, but no cache configuration exists with that name and no default cache has been set for this container
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:246)
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:388)
              at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:68)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.ejb3.component.singleton.StartupCountDownInterceptor.processInvocation(StartupCountDownInterceptor.java:25)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              ... 13 more
      Caused by: org.infinispan.commons.CacheConfigurationException: ISPN000436: Cache 'my-cache' has been requested, but no cache configuration exists with that name and no default cache has been set for this container
              at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:612)
              at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:599)
              at org.infinispan.manager.DefaultCacheManager.internalGetCache(DefaultCacheManager.java:481)
              at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:465)
              at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:451)
              at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:83)
              at com.?.?.?.InfinispanClusterSupport.getMyCache(MyCacheContainerBean.java:889)
              at com.?.?.?.InfinispanClusterSupport.(MyCacheContainerBean.java:863)
              at com.?.?.?.MyCacheContainerBean.initialize(MyCacheContainerBean.java:303)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_191]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_191]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_191]
              at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_191]
              at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:79)
              at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:126)
              at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:112)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:81)
              at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:89)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:112) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:112) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:111)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [wildfly-ee-16.0.0.Final.jar:16.0.0.Final]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) [jboss-invocation-1.5.2.Final.jar:1.5.2.Final]
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:237)
              ... 28 more

       

       

      ######################################################################################

      Here is the full contents of my ejb-jar.xml file in regards to MyCacheContainer.jar:

      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_2.xsd"
               version="3.2">
           <enterprise-beans>
                <session>
                     <ejb-name>MyCacheContainerBean</ejb-name>
                     <ejb-class>com.printrak.afis.ejb.MyCacheContainerBean</ejb-class>
                     <session-type>Singleton</session-type>
                     <resource-ref>
                          <res-ref-name>infinispan/MyCacheContainer</res-ref-name>
                          <res-type>org.infinispan.manager.CacheContainer</res-type>
                          <lookup-name>java:jboss/infinispan/container/MyCacheContainer</lookup-name>
                     </resource-ref>
                     <resource-ref>
                          <res-ref-name>infinispan/my-cache</res-ref-name>
                          <res-type>org.infinispan.configuration.cache.Configuration</res-type>
                          <lookup-name>java:jboss/infinispan/configuration/MyCacheContainer</lookup-name>
                     </resource-ref> 
                     <resource-ref>
                          <res-ref-name>infinispan/another-cache</res-ref-name>
                          <res-type>org.infinispan.configuration.cache.Configuration</res-type>
                          <lookup-name>java:jboss/infinispan/configuration/MyCacheContainer</lookup-name>
                     </resource-ref> 
                     <resource-ref>
                          <res-ref-name>infinispan/a-different-cache</res-ref-name>
                          <res-type>org.infinispan.configuration.cache.Configuration</res-type>
                          <lookup-name>java:jboss/infinispan/configuration/MyCacheContainer</lookup-name>
                     </resource-ref> 
                     <resource-ref>
                          <res-ref-name>infinispan/another-different-cache</res-ref-name>
                          <res-type>org.infinispan.configuration.cache.Configuration</res-type>
                          <lookup-name>java:jboss/infinispan/configuration/MyCacheContainer</lookup-name>
                     </resource-ref> 
                </session>
           </enterprise-beans>
      </ejb-jar>
      

       

       

      ######################################################################################

      Here is the contents of the cache container configurations that JBOSS tries to use when starting up:

              <subsystem xmlns="urn:jboss:domain:infinispan:8.0">
                  <cache-container name="server" aliases="singleton cluster" default-cache="default" module="org.wildfly.clustering.server">
                      <transport lock-timeout="60000"/>
                      <replicated-cache name="default">
                          <transaction mode="BATCH"/>
                      </replicated-cache>
                  </cache-container>
                  <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
                      <transport lock-timeout="60000"/>
                      <distributed-cache name="dist" l1-lifespan="0" owners="2">
                          <locking acquire-timeout="30000" isolation="REPEATABLE_READ"/>
                          <transaction mode="BATCH"/>
                          <file-store/>
                      </distributed-cache>
                  </cache-container>
                  <cache-container name="ejb" aliases="sfsb" default-cache="dist" module="org.wildfly.clustering.ejb.infinispan">
                      <transport lock-timeout="60000"/>
                      <distributed-cache name="dist" l1-lifespan="0" owners="2">
                          <locking isolation="REPEATABLE_READ"/>
                          <transaction mode="BATCH"/>
                          <file-store/>
                      </distributed-cache>
                  </cache-container>
                  <cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">
                      <transport lock-timeout="60000"/>
                      <local-cache name="local-query">
                          <object-memory size="10000"/>
                          <expiration max-idle="100000"/>
                      </local-cache>
                      <invalidation-cache name="entity">
                          <transaction mode="NON_XA"/>
                          <object-memory size="10000"/>
                          <expiration max-idle="100000"/>
                      </invalidation-cache>
                      <replicated-cache name="timestamps"/>
                  </cache-container>
                  <cache-container name="MyCacheContainer" alias="MyCacheContainer" default-cache="another-different-cache">
                      <transport lock-timeout="60000"/>
                      <replicated-cache name="another-different-cache">
                          <locking acquire-timeout="5000" isolation="REPEATABLE_READ"/>
                          <transaction locking="PESSIMISTIC" mode="NON_XA"/>
                      </replicated-cache>
                      <replicated-cache name="a-different-cache">
                          <locking acquire-timeout="5000" isolation="REPEATABLE_READ"/>
                          <transaction locking="PESSIMISTIC" mode="NON_XA"/>
                      </replicated-cache>
                      <replicated-cache name="another-cache">
                          <locking isolation="REPEATABLE_READ"/>
                      </replicated-cache>
                      <replicated-cache name="my-cache">
                          <locking isolation="REPEATABLE_READ"/>
                      </replicated-cache>
                  </cache-container>
              </subsystem>
      

       

      ######################################################################################

      Here is part of the JNDI tree in reference to Infinispan:

                     "infinispan" => {
                          "class-name" => "javax.naming.Context",
                          "children" => {
                              "container" => {
                                  "class-name" => "javax.naming.Context",
                                  "children" => {
                                      "ejb" => {
                                          "class-name" => "org.jboss.as.clustering.infinispan.DefaultCacheContainer",
                                          "value" => "ejb"
                                      },
                                      "hibernate" => {
                                          "class-name" => "org.jboss.as.clustering.infinispan.DefaultCacheContainer",
                                          "value" => "hibernate"
                                      },
                                      "MyCacheContainer" => {
                                          "class-name" => "org.jboss.as.clustering.infinispan.DefaultCacheContainer",
                                          "value" => "MyCacheContainer"
                                      },
                                      "server" => {
                                          "class-name" => "org.jboss.as.clustering.infinispan.DefaultCacheContainer",
                                          "value" => "server"
                                      },
                                      "web" => {
                                          "class-name" => "org.jboss.as.clustering.infinispan.DefaultCacheContainer",
                                          "value" => "web"
                                      }
                                  }
                              },
                              "configuration" => {
                                  "class-name" => "javax.naming.Context",
                                  "children" => {
                                      "web" => {
                                          "class-name" => "javax.naming.Context",
                                          "children" => {
                                              "default" => {
                                                  "class-name" => "org.infinispan.configuration.cache.Configuration",
                                                  "value" => "Configuration{simpleCache=simpleCache=false, clustering=ClusteringConfiguration [hashConfiguration=HashConfiguration [attributes=HashConfiguration = [
      consistentHashFactory=null, hash=MurmurHash3, numOwners=2, numSegments=256, capacityFactor=1.0, keyPartitioner=HashFunctionPartitioner{hashFunction=null, ns=0}]], l1Configuration=L1Configuration [attributes
      =L1Configuration = [enabled=false, invalidationThreshold=0, lifespan=0, cleanupTaskFrequency=60000]], stateTransferConfiguration=StateTransferConfigurationStoreAsBinaryConfiguration = [fetchInMemoryState=tr
      ue, timeout=240000, chunkSize=512, awaitInitialTransfer=true], syncConfiguration=SyncConfiguration [attributes=SyncConfiguration = [replTimeout=10000]], partitionHandlingConfiguration=PartitionHandlingConfi
      guration [attributes=PartitionHandlingConfiguration = [enabled=false, whenSplit=ALLOW_READ_WRITES, mergePolicy=NONE]], attributes=ClusteringConfiguration = [cacheMode=DIST_SYNC, remoteTimeout=10000, invalid
      ationBatchSize=128, biasAcquisition=ON_WRITE, biasLifespan=300000]], customInterceptors=CustomInterceptorsConfiguration [interceptors=[]], dataContainer=DataContainerConfiguration [attributes=DataContainerC
      onfiguration = [properties={}, dataContainer=null]], deadlockDetection=DeadlockDetectionConfiguration [attributes=DeadlockDetectionConfiguration = [enabled=false, spinDuration=-1]], encodingConfiguration= D
      ataTypeConfiguration [keyDataType=ContentTypeConfiguration [attributes=ContentTypeConfiguration = [media-type=null]], valueDataType=ContentTypeConfiguration [attributes=ContentTypeConfiguration = [media-typ
      e=null]]], eviction=EvictionConfiguration [attributes=EvictionConfiguration = [size=-1, type=COUNT, strategy=NONE, threadPolicy=DEFAULT]], expiration=ExpirationConfiguration [attributes=ExpirationConfigurat
      ion = [lifespan=-1, maxIdle=-1, reaperEnabled=true, wakeUpInterval=60000]], indexing=IndexingConfiguration [attributes=IndexingConfiguration = [properties={}, index=NONE, autoConfig=false, indexed-entities=
      []]], invocationBatching=InvocationBatchingConfiguration [attributes=InvocationBatchingConfiguration = [enabled=true]], jmxStatistics=JMXStatisticsConfiguration [attributes=JMXStatisticsConfiguration = [ena
      bled=false, available=false]], persistence=PersistenceConfiguration [attributes=PersistenceConfiguration = [passivation=true, availabilityInterval=1000, connectionAttempts=10, connectionInterval=50], stores
      =[SingleFileStoreConfiguration [attributes=SingleFileStoreConfiguration = [fetchPersistentState=true, purgeOnStartup=true, ignoreModifications=false, preload=false, shared=false, transactional=false, maxBat
      chSize=100, segmented=false, properties={}, location=/opt/bis/wildfly-16.0.0.Final/standalone/data/infinispan/web, maxEntries=-1, fragmentationFactor=0.75]]]], locking=LockingConfiguration [attributes=Locki
      ngConfiguration = [concurrencyLevel=1000, isolationLevel=REPEATABLE_READ, lockAcquisitionTimeout=30000, striping=false, writeSkewCheck=true]], modules={}, security=SecurityConfiguration [authorization=Autho
      rizationConfiguration [attributes=AuthorizationConfiguration = [enabled=false, roles=[]]]], storeAsBinary=StoreAsBinaryConfiguration [attributes=StoreAsBinaryConfiguration = [enabled=false, keys=true, value
      s=true]], transaction=TransactionConfiguration [attributes=TransactionConfiguration = [auto-commit=true, stop-timeout=10000, locking=PESSIMISTIC, transaction-manager-lookup=org.jboss.as.clustering.infinispa
      n.TransactionManagerProvider@1d2bb835, transaction-synchronization-registry-lookup=null, mode=TRANSACTIONAL, synchronization=false, single-phase-auto-commit=false, reaper-wake-up-interval=30000, complete-ti
      meout=60000, transaction-protocol=DEFAULT, notifications=true], recovery=RecoveryConfiguration [attributes=RecoveryConfiguration = [enabled=false, recoveryInfoCacheName=__recoveryInfoCacheName__]]], version
      ing=VersioningConfiguration = [enabled=true, scheme=SIMPLE], unsafe=UnsafeConfiguration = [unreliable-return-values=false], sites=SitesConfiguration [backupFor=BackupForConfiguration [attributes=BackupForCo
      nfiguration = [remoteCache=null, remoteSite=null]], allBackups=[], attributes=SitesConfiguration = [disable=true, backup-sites-in-use=[]]], compatibility=CompatibilityModeConfiguration [attributes=Compatibi
      lityModeConfiguration = [enabled=false, marshaller=null]], memory=MemoryConfiguration [attributes=MemoryConfiguration = [properties={}, storage=OBJECT, size=-1, type=COUNT, strategy=MANUAL, address-count=10
      48576]]}"
                                              },
                                              "dist" => {
                                                  "class-name" => "org.infinispan.configuration.cache.Configuration",
                                                  "value" => "Configuration{simpleCache=simpleCache=false, clustering=ClusteringConfiguration [hashConfiguration=HashConfiguration [attributes=HashConfiguration = [
      consistentHashFactory=null, hash=MurmurHash3, numOwners=2, numSegments=256, capacityFactor=1.0, keyPartitioner=HashFunctionPartitioner{hashFunction=null, ns=0}]], l1Configuration=L1Configuration [attributes
      =L1Configuration = [enabled=false, invalidationThreshold=0, lifespan=0, cleanupTaskFrequency=60000]], stateTransferConfiguration=StateTransferConfigurationStoreAsBinaryConfiguration = [fetchInMemoryState=tr
      ue, timeout=240000, chunkSize=512, awaitInitialTransfer=true], syncConfiguration=SyncConfiguration [attributes=SyncConfiguration = [replTimeout=10000]], partitionHandlingConfiguration=PartitionHandlingConfi
      guration [attributes=PartitionHandlingConfiguration = [enabled=false, whenSplit=ALLOW_READ_WRITES, mergePolicy=NONE]], attributes=ClusteringConfiguration = [cacheMode=DIST_SYNC, remoteTimeout=10000, invalid
      ationBatchSize=128, biasAcquisition=ON_WRITE, biasLifespan=300000]], customInterceptors=CustomInterceptorsConfiguration [interceptors=[]], dataContainer=DataContainerConfiguration [attributes=DataContainerC
      onfiguration = [properties={}, dataContainer=null]], deadlockDetection=DeadlockDetectionConfiguration [attributes=DeadlockDetectionConfiguration = [enabled=false, spinDuration=-1]], encodingConfiguration= D
      ataTypeConfiguration [keyDataType=ContentTypeConfiguration [attributes=ContentTypeConfiguration = [media-type=null]], valueDataType=ContentTypeConfiguration [attributes=ContentTypeConfiguration = [media-typ
      e=null]]], eviction=EvictionConfiguration [attributes=EvictionConfiguration = [size=-1, type=COUNT, strategy=NONE, threadPolicy=DEFAULT]], expiration=ExpirationConfiguration [attributes=ExpirationConfigurat
      ion = [lifespan=-1, maxIdle=-1, reaperEnabled=true, wakeUpInterval=60000]], indexing=IndexingConfiguration [attributes=IndexingConfiguration = [properties={}, index=NONE, autoConfig=false, indexed-entities=
      []]], invocationBatching=InvocationBatchingConfiguration [attributes=InvocationBatchingConfiguration = [enabled=true]], jmxStatistics=JMXStatisticsConfiguration [attributes=JMXStatisticsConfiguration = [ena
      bled=false, available=false]], persistence=PersistenceConfiguration [attributes=PersistenceConfiguration = [passivation=true, availabilityInterval=1000, connectionAttempts=10, connectionInterval=50], stores
      =[SingleFileStoreConfiguration [attributes=SingleFileStoreConfiguration = [fetchPersistentState=true, purgeOnStartup=true, ignoreModifications=false, preload=false, shared=false, transactional=false, maxBat
      chSize=100, segmented=false, properties={}, location=/opt/bis/wildfly-16.0.0.Final/standalone/data/infinispan/web, maxEntries=-1, fragmentationFactor=0.75]]]], locking=LockingConfiguration [attributes=Locki
      ngConfiguration = [concurrencyLevel=1000, isolationLevel=REPEATABLE_READ, lockAcquisitionTimeout=30000, striping=false, writeSkewCheck=true]], modules={}, security=SecurityConfiguration [authorization=Autho
      rizationConfiguration [attributes=AuthorizationConfiguration = [enabled=false, roles=[]]]], storeAsBinary=StoreAsBinaryConfiguration [attributes=StoreAsBinaryConfiguration = [enabled=false, keys=true, value
      s=true]], transaction=TransactionConfiguration [attributes=TransactionConfiguration = [auto-commit=true, stop-timeout=10000, locking=PESSIMISTIC, transaction-manager-lookup=org.jboss.as.clustering.infinispa
      n.TransactionManagerProvider@1d2bb835, transaction-synchronization-registry-lookup=null, mode=TRANSACTIONAL, synchronization=false, single-phase-auto-commit=false, reaper-wake-up-interval=30000, complete-ti
      meout=60000, transaction-protocol=DEFAULT, notifications=true], recovery=RecoveryConfiguration [attributes=RecoveryConfiguration = [enabled=false, recoveryInfoCacheName=__recoveryInfoCacheName__]]], version
      ing=VersioningConfiguration = [enabled=true, scheme=SIMPLE], unsafe=UnsafeConfiguration = [unreliable-return-values=false], sites=SitesConfiguration [backupFor=BackupForConfiguration [attributes=BackupForCo
      nfiguration = [remoteCache=null, remoteSite=null]], allBackups=[], attributes=SitesConfiguration = [disable=true, backup-sites-in-use=[]]], compatibility=CompatibilityModeConfiguration [attributes=Compatibi
      lityModeConfiguration = [enabled=false, marshaller=null]], memory=MemoryConfiguration [attributes=MemoryConfiguration = [properties={}, storage=OBJECT, size=-1, type=COUNT, strategy=MANUAL, address-count=10
      48576]]}"
                                              }
                                          }
                                      },
                                      "ejb" => {
                                          "class-name" => "javax.naming.Context",
                                          "children" => {
                                              "default" => {
                                                  "class-name" => "org.infinispan.configuration.cache.Configuration",
                                                  "value" => "Configuration{simpleCache=simpleCache=false, clustering=ClusteringConfiguration [hashConfiguration=HashConfiguration [attributes=HashConfiguration = [
      consistentHashFactory=null, hash=MurmurHash3, numOwners=2, numSegments=256, capacityFactor=1.0, keyPartitioner=HashFunctionPartitioner{hashFunction=null, ns=0}]], l1Configuration=L1Configuration [attributes
      =L1Configuration = [enabled=false, invalidationThreshold=0, lifespan=0, cleanupTaskFrequency=60000]], stateTransferConfiguration=StateTransferConfigurationStoreAsBinaryConfiguration = [fetchInMemoryState=tr
      ue, timeout=240000, chunkSize=512, awaitInitialTransfer=true], syncConfiguration=SyncConfiguration [attributes=SyncConfiguration = [replTimeout=10000]], partitionHandlingConfiguration=PartitionHandlingConfi
      guration [attributes=PartitionHandlingConfiguration = [enabled=false, whenSplit=ALLOW_READ_WRITES, mergePolicy=NONE]], attributes=ClusteringConfiguration = [cacheMode=DIST_SYNC, remoteTimeout=10000, invalid
      ationBatchSize=128, biasAcquisition=ON_WRITE, biasLifespan=300000]], customInterceptors=CustomInterceptorsConfiguration [interceptors=[]], dataContainer=DataContainerConfiguration [attributes=DataContainerC
      onfiguration = [properties={}, dataContainer=null]], deadlockDetection=DeadlockDetectionConfiguration [attributes=DeadlockDetectionConfiguration = [enabled=false, spinDuration=-1]], encodingConfiguration= D
      ataTypeConfiguration [keyDataType=ContentTypeConfiguration [attributes=ContentTypeConfiguration = [media-type=null]], valueDataType=ContentTypeConfiguration [attributes=ContentTypeConfiguration = [media-typ
      e=null]]], eviction=EvictionConfiguration [attributes=EvictionConfiguration = [size=-1, type=COUNT, strategy=NONE, threadPolicy=DEFAULT]], expiration=ExpirationConfiguration [attributes=ExpirationConfigurat
      ion = [lifespan=-1, maxIdle=-1, reaperEnabled=true, wakeUpInterval=60000]], indexing=IndexingConfiguration [attributes=IndexingConfiguration = [properties={}, index=NONE, autoConfig=false, indexed-entities=
      []]], invocationBatching=InvocationBatchingConfiguration [attributes=InvocationBatchingConfiguration = [enabled=true]], jmxStatistics=JMXStatisticsConfiguration [attributes=JMXStatisticsConfiguration = [ena
      bled=false, available=false]], persistence=PersistenceConfiguration [attributes=PersistenceConfiguration = [passivation=true, availabilityInterval=1000, connectionAttempts=10, connectionInterval=50], stores
      =[SingleFileStoreConfiguration [attributes=SingleFileStoreConfiguration = [fetchPersistentState=true, purgeOnStartup=true, ignoreModifications=false, preload=false, shared=false, transactional=false, maxBat
      chSize=100, segmented=false, properties={}, location=/opt/bis/wildfly-16.0.0.Final/standalone/data/infinispan/ejb, maxEntries=-1, fragmentationFactor=0.75]]]], locking=LockingConfiguration [attributes=Locki
      ngConfiguration = [concurrencyLevel=1000, isolationLevel=REPEATABLE_READ, lockAcquisitionTimeout=15000, striping=false, writeSkewCheck=true]], modules={}, security=SecurityConfiguration [authorization=Autho
      rizationConfiguration [attributes=AuthorizationConfiguration = [enabled=false, roles=[]]]], storeAsBinary=StoreAsBinaryConfiguration [attributes=StoreAsBinaryConfiguration = [enabled=false, keys=true, value
      s=true]], transaction=TransactionConfiguration [attributes=TransactionConfiguration = [auto-commit=true, stop-timeout=10000, locking=PESSIMISTIC, transaction-manager-lookup=org.jboss.as.clustering.infinispa
      n.TransactionManagerProvider@33ebe7ab, transaction-synchronization-registry-lookup=null, mode=TRANSACTIONAL, synchronization=false, single-phase-auto-commit=false, reaper-wake-up-interval=30000, complete-ti
      meout=60000, transaction-protocol=DEFAULT, notifications=true], recovery=RecoveryConfiguration [attributes=RecoveryConfiguration = [enabled=false, recoveryInfoCacheName=__recoveryInfoCacheName__]]], version
      ing=VersioningConfiguration = [enabled=true, scheme=SIMPLE], unsafe=UnsafeConfiguration = [unreliable-return-values=false], sites=SitesConfiguration [backupFor=BackupForConfiguration [attributes=BackupForCo
      nfiguration = [remoteCache=null, remoteSite=null]], allBackups=[], attributes=SitesConfiguration = [disable=true, backup-sites-in-use=[]]], compatibility=CompatibilityModeConfiguration [attributes=Compatibi
      lityModeConfiguration = [enabled=false, marshaller=null]], memory=MemoryConfiguration [attributes=MemoryConfiguration = [properties={}, storage=OBJECT, size=-1, type=COUNT, strategy=MANUAL, address-count=10
      48576]]}"
                                              },
                                              "dist" => {
                                                  "class-name" => "org.infinispan.configuration.cache.Configuration",
                                                  "value" => "Configuration{simpleCache=simpleCache=false, clustering=ClusteringConfiguration [hashConfiguration=HashConfiguration [attributes=HashConfiguration = [
      consistentHashFactory=null, hash=MurmurHash3, numOwners=2, numSegments=256, capacityFactor=1.0, keyPartitioner=HashFunctionPartitioner{hashFunction=null, ns=0}]], l1Configuration=L1Configuration [attributes
      =L1Configuration = [enabled=false, invalidationThreshold=0, lifespan=0, cleanupTaskFrequency=60000]], stateTransferConfiguration=StateTransferConfigurationStoreAsBinaryConfiguration = [fetchInMemoryState=tr
      ue, timeout=240000, chunkSize=512, awaitInitialTransfer=true], syncConfiguration=SyncConfiguration [attributes=SyncConfiguration = [replTimeout=10000]], partitionHandlingConfiguration=PartitionHandlingConfi
      guration [attributes=PartitionHandlingConfiguration = [enabled=false, whenSplit=ALLOW_READ_WRITES, mergePolicy=NONE]], attributes=ClusteringConfiguration = [cacheMode=DIST_SYNC, remoteTimeout=10000, invalid
      ationBatchSize=128, biasAcquisition=ON_WRITE, biasLifespan=300000]], customInterceptors=CustomInterceptorsConfiguration [interceptors=[]], dataContainer=DataContainerConfiguration [attributes=DataContainerC
      onfiguration = [properties={}, dataContainer=null]], deadlockDetection=DeadlockDetectionConfiguration [attributes=DeadlockDetectionConfiguration = [enabled=false, spinDuration=-1]], encodingConfiguration= D
      ataTypeConfiguration [keyDataType=ContentTypeConfiguration [attributes=ContentTypeConfiguration = [media-type=null]], valueDataType=ContentTypeConfiguration [attributes=ContentTypeConfiguration = [media-typ
      e=null]]], eviction=EvictionConfiguration [attributes=EvictionConfiguration = [size=-1, type=COUNT, strategy=NONE, threadPolicy=DEFAULT]], expiration=ExpirationConfiguration [attributes=ExpirationConfigurat
      ion = [lifespan=-1, maxIdle=-1, reaperEnabled=true, wakeUpInterval=60000]], indexing=IndexingConfiguration [attributes=IndexingConfiguration = [properties={}, index=NONE, autoConfig=false, indexed-entities=
      []]], invocationBatching=InvocationBatchingConfiguration [attributes=InvocationBatchingConfiguration = [enabled=true]], jmxStatistics=JMXStatisticsConfiguration [attributes=JMXStatisticsConfiguration = [ena
      bled=false, available=false]], persistence=PersistenceConfiguration [attributes=PersistenceConfiguration = [passivation=true, availabilityInterval=1000, connectionAttempts=10, connectionInterval=50], stores
      =[SingleFileStoreConfiguration [attributes=SingleFileStoreConfiguration = [fetchPersistentState=true, purgeOnStartup=true, ignoreModifications=false, preload=false, shared=false, transactional=false, maxBat
      chSize=100, segmented=false, properties={}, location=/opt/bis/wildfly-16.0.0.Final/standalone/data/infinispan/ejb, maxEntries=-1, fragmentationFactor=0.75]]]], locking=LockingConfiguration [attributes=Locki
      ngConfiguration = [concurrencyLevel=1000, isolationLevel=REPEATABLE_READ, lockAcquisitionTimeout=15000, striping=false, writeSkewCheck=true]], modules={}, security=SecurityConfiguration [authorization=Autho
      rizationConfiguration [attributes=AuthorizationConfiguration = [enabled=false, roles=[]]]], storeAsBinary=StoreAsBinaryConfiguration [attributes=StoreAsBinaryConfiguration = [enabled=false, keys=true, value
      s=true]], transaction=TransactionConfiguration [attributes=TransactionConfiguration = [auto-commit=true, stop-timeout=10000, locking=PESSIMISTIC, transaction-manager-lookup=org.jboss.as.clustering.infinispa
      n.TransactionManagerProvider@33ebe7ab, transaction-synchronization-registry-lookup=null, mode=TRANSACTIONAL, synchronization=false, single-phase-auto-commit=false, reaper-wake-up-interval=30000, complete-ti
      meout=60000, transaction-protocol=DEFAULT, notifications=true], recovery=RecoveryConfiguration [attributes=RecoveryConfiguration = [enabled=false, recoveryInfoCacheName=__recoveryInfoCacheName__]]], version
      ing=VersioningConfiguration = [enabled=true, scheme=SIMPLE], unsafe=UnsafeConfiguration = [unreliable-return-values=false], sites=SitesConfiguration [backupFor=BackupForConfiguration [attributes=BackupForCo
      nfiguration = [remoteCache=null, remoteSite=null]], allBackups=[], attributes=SitesConfiguration = [disable=true, backup-sites-in-use=[]]], compatibility=CompatibilityModeConfiguration [attributes=Compatibi
      lityModeConfiguration = [enabled=false, marshaller=null]], memory=MemoryConfiguration [attributes=MemoryConfiguration = [properties={}, storage=OBJECT, size=-1, type=COUNT, strategy=MANUAL, address-count=10
      48576]]}"
                                              }
                                          }
                                      }
                                  }
                              }
                          }
                      },
        • 1. Re: Fail to start custom cache container, in Infinispan Cluster
          pferraro

          Your jndi names are wrong.  Try this:

           

                         <resource-ref>

                              <res-ref-name>infinispan/my-cache</res-ref-name>

                              <res-type>org.infinispan.configuration.cache.Configuration</res-type>

                              <lookup-name>java:jboss/infinispan/configuration/MyCacheContainer/my-cache</lookup-name>

                         </resource-ref> 

                         <resource-ref>

                              <res-ref-name>infinispan/another-cache</res-ref-name>

                              <res-type>org.infinispan.configuration.cache.Configuration</res-type>

                              <lookup-name>java:jboss/infinispan/configuration/MyCacheContainer/another-cache</lookup-name>

                         </resource-ref> 

                         <resource-ref>

                              <res-ref-name>infinispan/a-different-cache</res-ref-name>

                              <res-type>org.infinispan.configuration.cache.Configuration</res-type>

                              <lookup-name>java:jboss/infinispan/configuration/MyCacheContainer/a-different-cache</lookup-name>

                         </resource-ref> 

                         <resource-ref>

                              <res-ref-name>infinispan/another-different-cache</res-ref-name>

                              <res-type>org.infinispan.configuration.cache.Configuration</res-type>

                              <lookup-name>java:jboss/infinispan/configuration/MyCacheContainer/another-different-cache</lookup-name>

                         </resource-ref> 

          • 2. Re: Fail to start custom cache container, in Infinispan Cluster
            brianwang17

            I actually originally had your suggested fix in my ejb-jar.xml, but from that I kept getting the same "<some-cache> requested, but configurations don't exist" error:

             

            2020-01-02 16:25:16,247 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "Application.ear")]) - 
                 failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"Application.ear\".\"MyCacheContainer.jar\".component.MyCacheContainerBean.START" => "java.lang.IllegalStateException: 
                 WFLYEE0042: Failed to construct component instance
                Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
                Caused by: javax.ejb.EJBException: org.infinispan.commons.CacheConfigurationException: ISPN000436: Cache 'my-cache' has been requested, but no cache configuration exists with that name and no default cache has been set for this container
                Caused by: org.infinispan.commons.CacheConfigurationException: ISPN000436: Cache my-cache' has been requested, but no cache configuration exists with that name and no default cache has been set for this container"}}
            2020-01-02 16:25:16,279 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
            WFLYCTL0186:   Services which failed to start:      service jboss.deployment.subunit."Application.ear"."MyCacheContainer.jar".component.MyCacheContainerBean.START: java.lang.IllegalStateException: 
                 WFLYEE0042: Failed to construct component instance
            WFLYCTL0448: 1 additional services are down due to their dependencies being missing or failed
            

            Is it maybe my cache container configurations are incorrect?

            <cache-container name="MyCacheContainer" alias="MyCacheContainer" default-cache="another-different-cache">
                 <transport lock-timeout="60000"/>
                 <replicated-cache name="another-different-cache">
                      <locking acquire-timeout="5000" isolation="REPEATABLE_READ"/>
                      <transaction locking="PESSIMISTIC" mode="NON_XA"/>
                 </replicated-cache>
                 <replicated-cache name="a-different-cache">
                      <locking acquire-timeout="5000" isolation="REPEATABLE_READ"/>
                      <transaction locking="PESSIMISTIC" mode="NON_XA"/>
                 </replicated-cache>
                 <replicated-cache name="another-cache">
                      <locking isolation="REPEATABLE_READ"/>
                 </replicated-cache>
                 <replicated-cache name="my-cache">
                      <locking isolation="REPEATABLE_READ"/>
                 </replicated-cache>
            </cache-container>
            
            • 3. Re: Fail to start custom cache container, in Infinispan Cluster
              pferraro

              This implies that the EmbeddedCacheManager has no cache configurations registered.  Can you paste your MyCacheContainerBean class as well as the ejb-jar.xml that threw the exception above?

              • 4. Re: Fail to start custom cache container, in Infinispan Cluster
                brianwang17

                Hi Paul, thanks for that last answer. It actually helped a lot. After reading your reply, I wanted to double-check how my cache configurations were being instantiated in the code and found out I was actually @Resource-ing my container incorrectly. I went ahead and re-applied the steps you mentioned in the other forum posting, Wildfly 12 Cache migration error , and actually got the cache configurations to be written into Jboss' JNDI Tree! Thanks for helping out there. To explain more into detail about what happened exactly, here it goes:

                 

                I double-checked your other forum mentioned above and noticed how you were writing your @Resource the SECOND time, being the "verbose" way you mentioned there. The code my organization has regarding how the cache container along with its caches are made definitely referred to your second method. I looked more closely at what I had as my @Resource and didn't realize until now that I was @Resource-ing my cache rather than my actual container.

                My @Resource originally looked like this:

                 

                @Resource("infinispan/my-cache")
                private Cache my-cache;
                @Resource("infinispan/another-cache")
                private Cache another-cache;
                @Resource("infinispan/a-different-cache")
                private Cache a-different-cache;
                @Resource("infinispan/another-different-cache")
                private Cache another-different-cache;

                when I should've just @Resource-d the container itself:

                @Resource("infinispan/MyCacheContainer")
                private EmbeddedCacheManager my-cache-container;

                This ^ how I finally understand what you meant would go into the ejb-jar.xml file and physically grab the res-ref-name that associates with that cache container name passed into @Resource. << AT LEAST, I hope that's what it meant! Please correct me if I am way off.

                 

                However if possible, do you mind helping out with a second issue I am experiencing?

                 

                We don't just have a Full-HA system that uses Application.ear. We actually have a standalone and remote-node (which is almost the same thing anyway as the standalone) systems that uses the SAME Application.ear. Now I understand that we could just have a separate pom.xml that bundles a totally different Application.ear that wouldn't have a MyCacheContainer.jar including the resource-ref from an ejb-jar.xml file. However, we would definitely like to NOT go through that approach. How could we go ahead about using the same Application.ear for a non-cluster system without having JBoss on startup fail deployment since the resource-ref would be missing the cache container in the standalone.xml file?

                 

                One thing I was thinking was just adding the cache container to the standalone.xml file for Jboss to use in creation of the JNDI Tree, BUT in the meantime, change the cache properties from a replicated-cache to a local-cache instead. When we tried it, the deployment succeeded, but the cache container which has a PESSIMISTIC locking mode configured was causing all our files on the standalone to be locked out. Is there any way we could get around this?

                 

                Also, if seriously possible, we would like to not have to add a JGroups channel to our standalone.xml file just for this to work. Sorry.