Friday, December 27, 2013

Exception in thread "main" java.lang.NoClassDefFoundError: javax/persistence/EntityListeners

Exception in thread "main" java.lang.NoClassDefFoundError: javax/persistence/EntityListeners at org.hibernate.cfg.annotations.reflection.JPAMetadataProvider.getDefaults(JPAMetadataProvider.java:96) at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getDefaults(JavaReflectionManager.java:226)
   at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1385)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1856)
   at com.ranga.mapping.Application.main(Application.java:13)

Problem:
This is caused by missing of the “hibernate-jpa-2.0-api-1.0.1.Final.jar“, usually happened in Hibernate transaction development.

Solution:
Add the hibernate-jpa-2.0-api-1.0.1.Final.jar file into your class path.

0 comments: