Java.lang.NoClassDefFoundError: org / hibernate / cache / spi / RegionFactory - when upgrading from spring 3 to spring 4

I am upgrading my spring project from 3.0.5 to 4.0.3.

The whole building is fine, but during boot, when spring tries to create beans, I find this error message:

enter image description here

The class is of course not present in ehcache-core, hibernate-ehcache, or hibernate-core. In fact, the package spi

just doesn't appear anywhere. However, I checked maven dependencies and it seems that spring 4.0.3 and hibernate 3.6.10 should be fully compatible. In my pom, I directly depend on hibernate-ehcache, which in turn automatically pulls the corresponding version of ehcache-core (apparently the thing done), like this:

My dependencies look like this:

enter image description here

enter image description here

I searched intensively for this error but can only find a couple of links to it. Given this obscurity, I am assuming that this is a configuration in my project somewhere referencing this RegionFactory class, however, despite searching multiple times, I cannot find anything.

Any ideas how I can get this project building with spring 4.0.3 ??

I can provide any additional details you need.

The key is to build the project with spring 4.0.3.Release. No matter which version of hibernate or ehcache allows me to do this, it doesn't really matter. Obviously my preference would be pom changes related to reconfiguration by code change ... but I'll take what I can get at this point.

EDIT: I am trying not to update my hibernate for 4.xy as this project is very large and uses HibernateDaoSupport

and HibernateTemplate

very widely (thousands of independent uses that take a long time to refactor)

+3


source to share


1 answer


Update version of Hibernate.

After Hibernate version 4.0.0.Final, they handle the batch from the RegionFactory.



3.6.10.Final: org.hibernate.cache.RegionFactory 4.0.0.Final: org.hibernate.cache.spi.RegionFactory.

+1


source







All Articles