Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.3.0.CR1
    • Fix Version/s: 4.3.9, 5.0.0.Beta1
    • Component/s: hibernate-envers
    • Labels:
      None

      Description

      When specifying a dynamic model mapping (in contrast to a POJO mapping) a NullPointerException is thrown when trying to build the EntityManagerFactory.

      It seems that Envers is trying to load the non existent POJO class (which is null for a dynamic model mapping). Here is the stack trace:

      javax.persistence.PersistenceException: Unable to build entity manager factory
      at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:82)
      at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55)
      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
      ...
      Caused by: java.lang.NullPointerException
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:270)
      at org.hibernate.annotations.common.util.ReflectHelper.classForName(ReflectHelper.java:60)
      at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.classForName(JavaReflectionManager.java:138)
      at org.hibernate.envers.configuration.internal.RevisionInfoConfiguration.configure(RevisionInfoConfiguration.java:324)
      at org.hibernate.envers.configuration.spi.AuditConfiguration.<init>(AuditConfiguration.java:119)
      at org.hibernate.envers.configuration.spi.AuditConfiguration.getFor(AuditConfiguration.java:180)
      at org.hibernate.envers.event.spi.EnversIntegrator.integrate(EnversIntegrator.java:76)
      at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1856)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:854)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:847)
      at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:396)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:846)
      at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:74)
      ... 31 more

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: