Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-6571

ClassNotFoundException while using remote-store for hibernate entity cache

    XMLWordPrintable

    Details

      Description

      • configure hibernate cache, default cache is entity
      • configure entity cache as invalidation-cache with remote-store
      • deploying an application having @Cachable entities

      -> you get:

      08:55:54,656 UTC INFO [org.hibernate.cache.spi.UpdateTimestampsCache] (ServerService Thread Pool – 28) HHH000250: Starting update timestamps cache at region: sample-ear.ear/sample-ejb.jar#primary.org.hibernate.ca che.spi.UpdateTimestampsCache
      08:55:54,656 UTC INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 28) WFLYCLINF0002: Started sample-ear.ear/sample-ejb.jar#primary.org.hibernate.cache.spi.UpdateTimestampsCache cache from hi bernate container
      08:55:54,656 UTC INFO [org.hibernate.cache.internal.StandardQueryCache] (ServerService Thread Pool – 28) HHH000248: Starting query cache at region: sample-ear.ear/sample-ejb.jar#primary.org.hibernate.cache.intern al.StandardQueryCache
      08:55:54,671 UTC INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 28) WFLYCLINF0002: Started sample-ear.ear/sample-ejb.jar#primary.org.hibernate.cache.internal.StandardQueryCache cache from hibernate container
      08:55:54,754 UTC ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool – 28) MSC000001: Failed to start service jboss.persistenceunit."sample-ear.ear/sample-ejb.jar#primary": org.jboss.msc.service.StartExc eption in service jboss.persistenceunit."sample-ear.ear/sample-ejb.jar#primary": javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-10.0.0.Final.jar:10.0.0.Final]
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-10.0.0.Final.jar:10.0.0.Final]
      at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-10.0.0.Final.jar:10.0.0.Final]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
      at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:954) [hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:882) [hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
      at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) [wildfly-jpa-10.0.0.Final.jar:10.0.0.Final]
      ... 7 more
      Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.persistence.manager.PersistenceManagerImpl.start() on object of type PersistenceManagerImpl
      at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:172)
      at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:870)
      at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:639)
      at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:628)
      at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:531)
      at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:222)
      at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:849)
      at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:621)
      at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:572)
      at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:440)
      at org.jboss.as.clustering.infinispan.DefaultCacheContainer.lambda$getCache$6(DefaultCacheContainer.java:119)
      at org.jboss.as.clustering.infinispan.DefaultCacheContainer$$Lambda$112/661685893.run(Unknown Source)
      at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:120)
      at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:114)
      at org.hibernate.cache.infinispan.InfinispanRegionFactory.getCache(InfinispanRegionFactory.java:673)
      at org.hibernate.cache.infinispan.InfinispanRegionFactory.buildEntityRegion(InfinispanRegionFactory.java:285)
      at org.hibernate.internal.SessionFactoryImpl.determineEntityRegionAccessStrategy(SessionFactoryImpl.java:619) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
      at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:332) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
      at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) [hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
      ... 9 more
      Caused by: org.infinispan.commons.CacheException: Unable to start cache loaders
      at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:174)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_45]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_45]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_45]
      at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_45]
      at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)
      ... 28 more
      Caused by: org.infinispan.commons.CacheConfigurationException: Unable to instantiate class org.infinispan.client.hotrod.impl.transport.tcp.RoundRobinBalancingStrategy
      at org.infinispan.commons.util.Util.loadClass(Util.java:103)
      at org.infinispan.client.hotrod.configuration.ConfigurationBuilder.balancingStrategy(ConfigurationBuilder.java:125)
      at org.infinispan.persistence.remote.RemoteStore.buildRemoteConfiguration(RemoteStore.java:221)
      at org.infinispan.persistence.remote.RemoteStore.start(RemoteStore.java:89)
      at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:141)
      ... 33 more
      Caused by: java.lang.ClassNotFoundException: org.infinispan.client.hotrod.impl.transport.tcp.RoundRobinBalancingStrategy from [Module "deployment.sample-ear.ear.sample-ejb.jar:main" from Service Module Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198) [jboss-modules.jar:1.5.1.Final]
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363) [jboss-modules.jar:1.5.1.Final]
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351) [jboss-modules.jar:1.5.1.Final]
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93) [jboss-modules.jar:1.5.1.Final]
      at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_45]
      at java.lang.Class.forName(Class.java:348) [rt.jar:1.8.0_45]
      at org.infinispan.commons.util.Util.loadClassStrict(Util.java:158)
      at org.infinispan.commons.util.Util.loadClass(Util.java:101)
      ... 37 more

      domain.xml is:

      {{<cache-container name="hibernate" default-cache="entity" module="org.hibernate.infinispan">
      <transport lock-timeout="60000"/>
      <local-cache name="local-query">
      <eviction strategy="LRU" max-entries="10000"/>
      <expiration max-idle="100000"/>
      </local-cache>
      <invalidation-cache name="entity" mode="SYNC">
      <eviction strategy="LRU" max-entries="1000"/>
      <expiration lifespan="45000" max-idle="30000"/>
      <remote-store cache="hibernateDistributed" socket-timeout="60000" tcp-no-delay="true" remote-servers="local-cache-server" fetch-state="false" passivation="false" preload="false" purge="true" shared="true"/>
      </invalidation-cache>
      <replicated-cache name="timestamps" mode="ASYNC"/>
      </cache-container>}}

      The attached infinispan.zip conatins some changes to the module configuration
      (module.xml's) in $JBOSS_HOME/modules/system/layers/base/org/infinispan. This
      config changes are marked wih ALVARA an fix the problem for us.

        Attachments

        1. infinispan.zip
          4 kB
        2. persistence.xml
          2 kB
        3. sample.zip
          76 kB
        4. standalone.sample.ha.xml
          32 kB

          Activity

            People

            Assignee:
            pferraro Paul Ferraro
            Reporter:
            gvwolf3d Gunther vw
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: