java.lang.NoClassDefFoundError

javax/persistence/EntityListeners

Samebug tips9

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.


rafaelrafael

NoClassDefFoundError means java has failed to find a class you're trying to instantiate, look if you've added the class you're trying to instantiate to the dependencies.


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Stack trace

  • 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:1353) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1824) at com.vaannila.util.HibernateUtil.<clinit>(HibernateUtil.java:10) at com.vaannila.course.Main.saveCourse(Main.java:26) at com.vaannila.course.Main.main(Main.java:15) Caused by: java.lang.ClassNotFoundException: javax.persistence.EntityListeners at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 7 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

Unknown visitor
Unknown visitor2 times, last one
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitor2 times, last one
Unknown visitor
Unknown visitorOnce,
2363 more bugmates