spring整合hibernate中遇到的坑

来源:互联网 发布:影片去码软件 编辑:程序博客网 时间:2024/05/21 21:47

1.java.lang.NoClassDefFoundError: org/hibernate/util/DTDEntityResolver

这个错误是hibernate版本在3.5以上的时候还集成了hibernate-annotations包,报出的错误。
     解决方法:检查hibernate版本,如果在3.5以上去掉hibernate-annotations包

2.org/hibernate/HibernateException : Unsupported major.minor version 52.0 (unable to load class org.hibernate.HibernateException)
这个是hibernate版本和spring版本不匹配,请降低/升级hibernate版本 or 升级/降低spring版本

3.@MappedSuperclass 注解

把多个实体的公用部分提取出来,然后继承的时候 需要在父类上面加上@MappedSuperclass注解
0 0
原创粉丝点击