Java.lang.ClassNotFoundException:javax.persistence.EntityListeners

Source: Internet
Author: User

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.jxd.studenttest.main ( STUDENTTEST.JAVA:21) caused by: java.lang.classnotfoundexception:  Javax.persistence.EntityListeners At java.net.urlclassloader$1.run (urlclassloader.java:202) at  Java.security.AccessController.doPrivileged (Native method) At java.net.urlclassloader.findclass ( urlclassloader.java:190) At java.lang.classloader.loadclass (classloader.java:306) at sun.misc.Launcher $AppClassLoader. LoadClass (launcher.java:301)At java.lang.classloader.loadclass (classloader.java:247)

... 5 more

Cause of error: This is because Hibernate 3.6 relies on JPA, so a JPA jar package must be included in the class path. You can find one in the Hibernate solution: include the Hibernate-jpa-2.0-api-1.0.0.final.jar package in class path. The package can be found in the hibernate-distribution-3.6.0.final/lib/directory

Java.lang.ClassNotFoundException:javax.persistence.EntityListeners

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.