javax.persistence.PersistenceException: [PersistenceUnit: mysql_hbm] Unable to build Hibernate SessionFactory


Solutions on the web

Solution icon of hibernate
via Hibernate JIRA by Pawel Solarski, 1 year ago
[PersistenceUnit: mysql_hbm] Unable to build Hibernate SessionFactory

Solution icon of github
via GitHub by deepu105
, 1 year ago
[PersistenceUnit: default] Unable to build Hibernate SessionFactory

Solution icon of googlegroups
[PersistenceUnit: TransportPU] Unable to build Hibernate SessionFactory

Solution icon of hibernate
via Hibernate JIRA by Michèle BARRE, 10 months ago
[PersistenceUnit: dpmmcGeolocPersistenceUnit] Unable to build Hibernate SessionFactory

Solution icon of hibernate
via Hibernate JIRA by Johannes Zinn, 1 year ago
[PersistenceUnit: projectPU] Unable to build Hibernate SessionFactory

Solution icon of hibernate
via Hibernate JIRA by Maxim Frolov, 1 year ago
[PersistenceUnit: MappingException] Unable to build Hibernate SessionFactory

Solution icon of hibernate
via Hibernate JIRA by Luca Domenichini, 1 year ago
[PersistenceUnit: TestPU] Unable to build Hibernate SessionFactory

Solution icon of sourceforge
[PersistenceUnit: ejbca] Unable to build Hibernate SessionFactory

Solution icon of stackoverflow
[PersistenceUnit: springmvcapp_pu_singletable] Unable to build Hibernate SessionFactory

Solution icon of stackoverflow
via Stack Overflow by Alberto Crespo
, 1 year ago
[PersistenceUnit: default] Unable to build Hibernate SessionFactory

Stack trace

javax.persistence.PersistenceException: [PersistenceUnit: mysql_hbm] Unable to build Hibernate SessionFactory
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:961)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:891)
	at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:58)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
	at jpa.JPARunner.<init>(JPARunner.java:18)
	at jpa.advanced.DerivedIdExample.<init>(DerivedIdExample.java:11)
	at jpa.advanced.DerivedIdExample.main(DerivedIdExample.java:14)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.hibernate.MappingException: Composite-id class must implement Serializable: jpa.advanced.EmployeeInfo
	at org.hibernate.mapping.RootClass.checkCompositeIdentifier(RootClass.java:291)
	at org.hibernate.mapping.RootClass.validate(RootClass.java:274)
	at org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:329)
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:482)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:888)
	... 11 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

3 times, 4 days ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 3 days ago
3 times, 1 week ago
7 times, 1 month ago
18 more bugmates