Uploaded image for project: 'Hibernate ORM'
  1. HHH-8775

Exception when mapping a class more than once

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      When a class is mapped more than once, as defined in the documentation - http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch05.html#mapping-entityname - a PersistenceException is thrown when creating the EntityManagerFactory.

      stack trace:

      javax.persistence.PersistenceException: Error build callback listeners; entity [org.example.ExampleEntity was already processed
      at org.hibernate.jpa.event.internal.jpa.CallbackRegistryImpl.addEntityCallbacks(CallbackRegistryImpl.java:131)
      at org.hibernate.jpa.event.internal.jpa.LegacyCallbackProcessor.processCallbacksForEntity(LegacyCallbackProcessor.java:71)
      at org.hibernate.jpa.event.spi.JpaIntegrator.integrate(JpaIntegrator.java:150)
      at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
      at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:399)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
      at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:73)
      at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)

        Attachments

          Issue links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 37m
                  37m