Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-13807

[GSS](7.0.z) Unable to share single cache region with entity and collection

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 7.1.0.GA, 7.0.9.GA, 7.2.0.GA
    • JPA/Hibernate
    • None
    • Release Notes

      Using @org.hibernate.annotations.Cache(region="somename" ...) to specify the same region for both an entity and a collection results in a failure (like the below from EAP 7.1) when deploying a persistent unit:

      ... Failed to start service jboss.persistenceunit."jboss.eap-1.0-SNAPSHOT.jar#jboss-eap-hibernate": org.jboss.msc.service.StartException in service jboss.persistenceunit."jboss.eap-1.0-SNAPSHOT.jar#jboss-eap-hibernate": javax.persistence.PersistenceException: [PersistenceUnit: jboss-eap-hibernate] Unable to build Hibernate SessionFactory
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:195)
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:125)
      	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:640)
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:209)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: jboss-eap-hibernate] Unable to build Hibernate SessionFactory
      	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:953)
      	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:883)
      	at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167)
      	... 7 more
      Caused by: java.lang.ClassCastException: org.hibernate.cache.infinispan.entity.ReadWriteAccess cannot be cast to org.hibernate.cache.spi.access.CollectionRegionAccessStrategy
      	at org.hibernate.internal.SessionFactoryImpl.determineCollectionRegionAccessStrategy(SessionFactoryImpl.java:656)
      	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:406)
      	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:422)
      	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:880)
      	...
      

              gbadner@redhat.com Gail Badner (Inactive)
              rhn-support-sfikes Stephen Fikes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: