2

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. 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"

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.

Do I need an other configuration? Or an other version?

1 Answers1

0

You just need to add to unitils configuration next line:

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

empyros
  • 121
  • 5
  • It does not work for me. I use unitils-orm 3.4.6 and hibernate 5.0.10.Final. – Mariusz Nov 02 '18 at 10:43
  • Among others I have following jars on classpath: hibernate-entitymanager-5.0.10.Final.jar hibernate-commons-annotations-5.0.1.Final.jar hibernate-jpa-2.1-api-1.0.0.Final.jar hibernate-core-5.0.10.Final.jar hibernate-ehcache-5.0.10.Final.jar unitils-orm-3.4.6.jar – Mariusz Nov 02 '18 at 10:48