2

I'm trying to a JPA annotation one -to- one. but getting following error

Exception in thread "main" java.lang.IncompatibleClassChangeError: class org.hibernate.cfg.ExtendedMappings has interface org.hibernate.cfg.Mappings as super class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
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)
at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:182)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:272)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1377)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at com.HiberAnnJS.main(HiberAnnJS.java:21)

I don't know what i have to do.

DataNucleus
  • 15,497
  • 3
  • 32
  • 37
Silambarasan
  • 299
  • 2
  • 4
  • 14
  • The same problem is seen in the next [post](http://stackoverflow.com/questions/1497619/testng-and-spring-3) – Jhonathan Dec 29 '11 at 03:00

1 Answers1

13

I think you are using incompatible versions of hibernate core and annotations. One of the possible combination is Hibernate Core 3.3.2 with Hibernate Annotations 3.4 and try. Have a look at the Compatibility matrix here for more details.

ManuPK
  • 11,623
  • 10
  • 57
  • 76