简体   繁体   English

unitils-orm-hibernate无法使用Hibernate 5

[英]unitils-orm-hibernate not working with Hibernate 5

I'm using unitils for hibernate orm testing. 我正在使用单元进行休眠测试。 I took the hibernate version 5.0.10-Final and the latest unitils version 3.4.3. 我采用了hibernate版本5.0.10-Final和最新的unitils版本3.4.3。 I'm always getting the following error: "org.unitils.core.UnitilsException: An exception occured during the loading of core module hibernate with module class name org.unitils.orm.hibernate.HibernateModule -> Caused by: org.unitils.core.UnitilsException: Could not load class with name org.hibernate.cfg.AnnotationConfiguration" 我总是收到以下错误:“org.unitils.core.UnitilsException:在加载核心模块hibernate期间发生了一个异常,模块类名为org.unitils.orm.hibernate.HibernateModule - >引起:org.unitils。 core.UnitilsException:无法加载名为org.hibernate.cfg.AnnotationConfiguration的类“

When I look into the code I can see (in older version of Hibernate 4) that the AnnotationConfiguration is deprecated and will be replaced in Hibernate 5. Apparently the unitils still expects the class to be there as the property 'HibernateModule.configuration.implClassName' still points towards this class. 当我查看代码时,我可以看到(在较旧版本的Hibernate 4中)AnnotationConfiguration已弃用,将在Hibernate 5中被替换。显然,单元仍然希望类作为属性'HibernateModule.configuration.implClassName'存在仍然指向这个班级。

Do I need an other configuration? 我还需要其他配置吗? Or an other version? 还是其他版本?

You just need to add to unitils configuration next line: 您只需要在下一行添加到unitils配置:

HibernateModule.configuration.implClassName=org.hibernate.cfg.Configuration HibernateModule.configuration.implClassName = org.hibernate.cfg.Configuration

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM