Hi All,
I have just started learning Hibernate. And following tutorial @
http://www.vaannila.com/hibernate/hiber ... ols-1.html. And have included following jars as user libraries in project:-
antlr-2.7.6.jar,commons-collections-3.1.jar,dom4j-1.6.1.jar,hibernate3.jar,javassist-3.12.0.GA.jar,jta-1.1.jar,log4j-1.2.8.jar,mysql-connector-java-5.1.13-bin.jar,slf4j-api-1.6.1.jar,slf4j-simple-1.6.1.jar.
But when I am running the Main program I am getting following error in console:-
Code:
312 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
344 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.6.0.CR2
344 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
344 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
375 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
547 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
969 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
4266 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
4437 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/vaannila/course/Course.hbm.xml
6828 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
7015 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
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: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
Request you all to please help in solveing the above error.