Updated from version 5.2.11 to 5.2.14
Startup now yields the following error:
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: .....] Unable to build Hibernate SessionFactory at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:970) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:895) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:58) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) ... Caused by: org.hibernate.MappingException: Could not instantiate persister org.hibernate.persister.entity.JoinedSubclassEntityPersister at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:112) at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77) at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:128) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:300) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:460) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892)
After several hours of searching, I somewhat found the error.
If an EntityA has a member variable like
{code:java} Set<EntityB> attributes {code} where EntityB inherits from some BaseEntity, the error is generated. As soon as I change the name "attributes" to something else, or remove the inheritance from EntityB, the issue seems to be fixed.
A minimal example would look something like this:
{code:java} @Entity @Inheritance(strategy=InheritanceType.JOINED) // or other public class BaseEntity { @Id private long id; }
@Entity public class EntityA extends BaseEntity { @OneToMany(fetch=FetchType.LAZY) private Set<EntityB> attributes; // attributes as name seems to yield the error }
@Entity public class EntityB { @Id private long id; } {code}
However, while the minimal example did not trigger the error, All other combinations with various of my classes reproduced the error, when above two conditions were met. So there seem to be some additional requirements to trigger the error, I could not yet determine. |
|