We're updating the issue view to help you get more done. 

Exception when mapping a class more than once

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)

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Felix Feisst

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.0.Final
4.3.0.CR2
4.3.0.CR1
4.3.8

Priority

Major