javax.persistence.PersistenceException: [PersistenceUnit: maj2e-langfr-dev] Unable to build Hibernate SessionFactory

Hibernate JIRA | Frank Langelage | 1 year ago
  1. 0

    After upgrading WildFly to latest alpha5 including the Hibernate ORM update to 5.0.0.CR2 the persistence unit inside my ear cannot be started anymore. Stacktrace below. The same code worked just fine with latest WildFly 10 alpha before the ORM upgrade from 4.3.10 to 5.0.0. Entities which are @Cacheable and have a composite key (@IdClass) are the cause of the problem. One example attached. {noformat:title=output} 11.07. 12:17:54,698 INFO [org.jboss.as.jpa#run] WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'maj2e-langfr-dev.ear/ejb-entity.jar#maj2e-langfr-dev' 11.07. 12:17:54,954 INFO [org.hibernate.jpa.internal.util.LogHelper#logPersistenceUnitInformation] HHH000204: Processing PersistenceUnitInfo [ name: maj2e-langfr-dev ...] 11.07. 12:17:55,546 INFO [org.hibernate.Version#logVersion] HHH000412: Hibernate Core {5.0.0.CR2} 11.07. 12:17:55,552 INFO [org.hibernate.cfg.Environment#<clinit>] HHH000206: hibernate.properties not found 11.07. 12:17:55,562 INFO [org.hibernate.cfg.Environment#buildBytecodeProvider] HHH000021: Bytecode provider name : javassist 11.07. 12:17:55,701 INFO [org.hibernate.orm.deprecation#<init>] HHH90000001: Found usage of deprecated setting for specifying Scanner [hibernate.ejb.resource_scanner]; use [hibernate.archive.scanner] instead 11.07. 12:17:55,761 INFO [org.hibernate.annotations.common.Version#<clinit>] HCANN000001: Hibernate Commons Annotations {5.0.0.Final} 11.07. 12:17:55,877 INFO [org.jboss.weld.deployer#deploy] WFLYWELD0003: Processing weld deployment ejb-session-core.jar 11.07. 12:17:55,940 INFO [org.jboss.weld.deployer#deploy] WFLYWELD0006: Starting Services for CDI deployment: maj2e-langfr-dev.ear 11.07. 12:17:56,447 INFO [org.jboss.weld.Version#<clinit>] WELD-000900: 2.3.0 (Beta2) 11.07. 12:18:14,049 INFO [org.jboss.weld.deployer#start] WFLYWELD0009: Starting weld service for deployment maj2e-langfr-dev.ear [GC (Allocation Failure) [PSYoungGen: 475136K->58002K(573440K)] 560180K->143054K(1974272K), 0.4947124 secs] [Times: user=0.80 sys=0.04, real=0.49 secs] 11.07. 12:18:18,028 INFO [org.jboss.as.jpa#run] WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'maj2e-langfr-dev.ear/ejb-entity.jar#maj2e-langfr-dev' 11.07. 12:18:19,201 INFO [org.hibernate.dialect.Dialect#<init>] HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect 11.07. 12:18:19,521 INFO [org.hibernate.envers.boot.internal.EnversServiceImpl#configure] Envers integration enabled? : true [GC (Allocation Failure) [PSYoungGen: 537234K->50463K(581632K)] 622286K->135516K(1982464K), 0.4342550 secs] [Times: user=0.80 sys=0.00, real=0.43 secs] 11.07. 12:18:36,361 ERROR [org.jboss.msc.service.fail#failed] MSC000001: Failed to start service jboss.persistenceunit."maj2e-langfr-dev.ear/ejb-entity.jar#maj2e-langfr-dev": org.jboss.msc.service.StartException in service jboss.persistenceunit."maj2e-langfr-dev.ear/ejb-entity.jar#maj2e-langfr-dev": javax.persistence.PersistenceException: [PersistenceUnit: maj2e-langfr-dev] Unable to build Hibernate SessionFactory at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:666) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) 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: maj2e-langfr-dev] Unable to build Hibernate SessionFactory at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:877) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:805) at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) ... 7 more Caused by: java.lang.NullPointerException at org.hibernate.cache.internal.CacheDataDescriptionImpl.decode(CacheDataDescriptionImpl.java:77) at org.hibernate.internal.SessionFactoryImpl.determineEntityRegionAccessStrategy(SessionFactoryImpl.java:628) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:330) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:802) ... 9 more {noformat} {code:xml|title=persistence.xml} <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" version="2.1"> <persistence-unit name="@MBI_DBNAME@" transaction-type="JTA"> <jta-data-source>java:jboss/datasources/@MBI_DBNAME@</jta-data-source> <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode> <validation-mode>NONE</validation-mode> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.@HIBERNATE_DIALECT@"/> <!-- used values are "org.hibernate.dialect.Oracle10gDialect" "org.hibernate.dialect.InformixDialect" --> <property name="hibernate.show_sql" value="@SHOW_SQL@"/> <property name="hibernate.format_sql" value="@SHOW_SQL@"/> <property name="hibernate.use_sql_comments" value="@SHOW_SQL@"/> </properties> </persistence-unit> </persistence> {code}

    Hibernate JIRA | 1 year ago | Frank Langelage
    javax.persistence.PersistenceException: [PersistenceUnit: maj2e-langfr-dev] Unable to build Hibernate SessionFactory
  2. 0

    After upgrading WildFly to latest alpha5 including the Hibernate ORM update to 5.0.0.CR2 the persistence unit inside my ear cannot be started anymore. Stacktrace below. The same code worked just fine with latest WildFly 10 alpha before the ORM upgrade from 4.3.10 to 5.0.0. Entities which are @Cacheable and have a composite key (@IdClass) are the cause of the problem. One example attached. {noformat:title=output} 11.07. 12:17:54,698 INFO [org.jboss.as.jpa#run] WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'maj2e-langfr-dev.ear/ejb-entity.jar#maj2e-langfr-dev' 11.07. 12:17:54,954 INFO [org.hibernate.jpa.internal.util.LogHelper#logPersistenceUnitInformation] HHH000204: Processing PersistenceUnitInfo [ name: maj2e-langfr-dev ...] 11.07. 12:17:55,546 INFO [org.hibernate.Version#logVersion] HHH000412: Hibernate Core {5.0.0.CR2} 11.07. 12:17:55,552 INFO [org.hibernate.cfg.Environment#<clinit>] HHH000206: hibernate.properties not found 11.07. 12:17:55,562 INFO [org.hibernate.cfg.Environment#buildBytecodeProvider] HHH000021: Bytecode provider name : javassist 11.07. 12:17:55,701 INFO [org.hibernate.orm.deprecation#<init>] HHH90000001: Found usage of deprecated setting for specifying Scanner [hibernate.ejb.resource_scanner]; use [hibernate.archive.scanner] instead 11.07. 12:17:55,761 INFO [org.hibernate.annotations.common.Version#<clinit>] HCANN000001: Hibernate Commons Annotations {5.0.0.Final} 11.07. 12:17:55,877 INFO [org.jboss.weld.deployer#deploy] WFLYWELD0003: Processing weld deployment ejb-session-core.jar 11.07. 12:17:55,940 INFO [org.jboss.weld.deployer#deploy] WFLYWELD0006: Starting Services for CDI deployment: maj2e-langfr-dev.ear 11.07. 12:17:56,447 INFO [org.jboss.weld.Version#<clinit>] WELD-000900: 2.3.0 (Beta2) 11.07. 12:18:14,049 INFO [org.jboss.weld.deployer#start] WFLYWELD0009: Starting weld service for deployment maj2e-langfr-dev.ear [GC (Allocation Failure) [PSYoungGen: 475136K->58002K(573440K)] 560180K->143054K(1974272K), 0.4947124 secs] [Times: user=0.80 sys=0.04, real=0.49 secs] 11.07. 12:18:18,028 INFO [org.jboss.as.jpa#run] WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'maj2e-langfr-dev.ear/ejb-entity.jar#maj2e-langfr-dev' 11.07. 12:18:19,201 INFO [org.hibernate.dialect.Dialect#<init>] HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect 11.07. 12:18:19,521 INFO [org.hibernate.envers.boot.internal.EnversServiceImpl#configure] Envers integration enabled? : true [GC (Allocation Failure) [PSYoungGen: 537234K->50463K(581632K)] 622286K->135516K(1982464K), 0.4342550 secs] [Times: user=0.80 sys=0.00, real=0.43 secs] 11.07. 12:18:36,361 ERROR [org.jboss.msc.service.fail#failed] MSC000001: Failed to start service jboss.persistenceunit."maj2e-langfr-dev.ear/ejb-entity.jar#maj2e-langfr-dev": org.jboss.msc.service.StartException in service jboss.persistenceunit."maj2e-langfr-dev.ear/ejb-entity.jar#maj2e-langfr-dev": javax.persistence.PersistenceException: [PersistenceUnit: maj2e-langfr-dev] Unable to build Hibernate SessionFactory at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:666) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) 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: maj2e-langfr-dev] Unable to build Hibernate SessionFactory at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:877) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:805) at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) ... 7 more Caused by: java.lang.NullPointerException at org.hibernate.cache.internal.CacheDataDescriptionImpl.decode(CacheDataDescriptionImpl.java:77) at org.hibernate.internal.SessionFactoryImpl.determineEntityRegionAccessStrategy(SessionFactoryImpl.java:628) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:330) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:802) ... 9 more {noformat} {code:xml|title=persistence.xml} <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" version="2.1"> <persistence-unit name="@MBI_DBNAME@" transaction-type="JTA"> <jta-data-source>java:jboss/datasources/@MBI_DBNAME@</jta-data-source> <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode> <validation-mode>NONE</validation-mode> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.@HIBERNATE_DIALECT@"/> <!-- used values are "org.hibernate.dialect.Oracle10gDialect" "org.hibernate.dialect.InformixDialect" --> <property name="hibernate.show_sql" value="@SHOW_SQL@"/> <property name="hibernate.format_sql" value="@SHOW_SQL@"/> <property name="hibernate.use_sql_comments" value="@SHOW_SQL@"/> </properties> </persistence-unit> </persistence> {code}

    Hibernate JIRA | 1 year ago | Frank Langelage
    javax.persistence.PersistenceException: [PersistenceUnit: maj2e-langfr-dev] Unable to build Hibernate SessionFactory
  3. 0

    JPA, Hibernate, postgreSQL: Unable to build Hibernate SessionFactory

    Stack Overflow | 2 years ago | ilovkatie
    javax.persistence.PersistenceException: [PersistenceUnit: Lab1] Unable to build Hibernate SessionFactory
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JPA OneToMany list does not find mappedBy property which should be inherited

    Stack Overflow | 1 year ago | Christian Gerstner
    javax.persistence.PersistenceException: [PersistenceUnit: ExamplePU] Unable to build Hibernate SessionFactory
  6. 0

    Hibernate ClassCastException org.hibernate.type.SerializableType cannot be cast to org.hibernate.type.VersionType ยป

    nu-no.nl | 11 months ago
    javax.persistence.PersistenceException: [PersistenceUnit: testPU] Unable to build Hibernate SessionFactory

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.persistence.PersistenceException

      [PersistenceUnit: maj2e-langfr-dev] Unable to build Hibernate SessionFactory

      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run()
    2. JPA
      PersistenceUnitServiceImpl$1$1.run
      1. org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)
      2. org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
      2 frames
    3. WildFly Security Manager
      WildFlySecurityManager.doChecked
      1. org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:666)
      1 frame
    4. JPA
      PersistenceUnitServiceImpl$1.run
      1. org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)
      1 frame
    5. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames
    6. JBoss Threads
      JBossThread.run
      1. org.jboss.threads.JBossThread.run(JBossThread.java:320)
      1 frame