Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-757

javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory when using Infinispan as 2nd level cache for hibernate

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2016.10.0
    • Fix Version/s: 2016.11.0
    • Component/s: None
    • Labels:
      None

      Description

      I am trying to enable Infinispan as a 2nd level cache for hibernate. As soon as I enable it, I get the following startup exception:

      016-10-06 13:48:58,182 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 7) MSC000001: Failed to start service jboss.persistenceunit."demo.war#primary": org.jboss.msc.service.StartException in service jboss.persistenceunit."demo.war#primary": javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:179)
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:121)
      	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:193)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      	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)
      	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:882)
      	at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:161)
      	... 7 more
      Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]
      	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:264)
      	at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:228)
      	at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207)
      	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:242)
      	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
      	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879)
      	... 9 more
      Caused by: org.hibernate.cache.CacheException: Infinispan custom cache command factory not installed (possibly because the classloader where Infinispan lives couldn't find the Hibernate Infinispan cache provider)
      	at org.hibernate.cache.infinispan.InfinispanRegionFactory.getCacheCommandFactory(InfinispanRegionFactory.java:716)
      	at org.hibernate.cache.infinispan.InfinispanRegionFactory.startRegion(InfinispanRegionFactory.java:552)
      	at org.hibernate.cache.infinispan.InfinispanRegionFactory.buildTimestampsRegion(InfinispanRegionFactory.java:332)
      	at org.hibernate.cache.spi.UpdateTimestampsCache.<init>(UpdateTimestampsCache.java:57)
      	at org.hibernate.internal.CacheImpl.<init>(CacheImpl.java:53)
      	at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:28)
      	at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:20)
      	at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:46)
      	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:254)
      	... 14 more
      
      2016-10-06 13:48:58,184 ERROR [org.jboss.as.controller.management-operation] (main) WFLYCTL0013: Operation ("add") failed - address: (("deployment" => "demo.war")) - failure description: {
          "WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"demo.war#primary\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"demo.war#primary\": javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory
          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory
          Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]
          Caused by: org.hibernate.cache.CacheException: Infinispan custom cache command factory not installed (possibly because the classloader where Infinispan lives couldn't find the Hibernate Infinispan cache provider)"},
          "WFLYCTL0412: Required services that are not installed:" => ["jboss.persistenceunit.\"demo.war#primary\""],
          "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
      }
      2016-10-06 13:48:58,185 ERROR [org.jboss.as.server] (main) WFLYSRV0021: Deploy of deployment "demo.war" was rolled back with the following failure message: 
      {
          "WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"demo.war#primary\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"demo.war#primary\": javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory
          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory
          Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]
          Caused by: org.hibernate.cache.CacheException: Infinispan custom cache command factory not installed (possibly because the classloader where Infinispan lives couldn't find the Hibernate Infinispan cache provider)"},
          "WFLYCTL0412: Required services that are not installed:" => ["jboss.persistenceunit.\"demo.war#primary\""],
          "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
      }
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  gastaldi George Gastaldi
                  Reporter:
                  davidbenninger David Benninger
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: