Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.IncompatibleClassChangeError

Tags:

hibernate

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.

like image 724
Silambarasan Avatar asked Dec 01 '25 08:12

Silambarasan


1 Answers

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.

like image 166
ManuPK Avatar answered Dec 07 '25 00:12

ManuPK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!