When trying to configure second level cache with hibernate 5.1.5 we are running into the following error:
Caused by: java.lang.ClassNotFoundException: org.hibernate.cache.spi.support.RegionFactoryTemplate
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161]
Dependencies are as follows:
compile group: 'org.hibernate', name: 'hibernate-ehcache', version: '5.1.5.Final'
compile group: 'org.hibernate', name: 'hibernate-jcache', version: '5.3.1.Final'
compile group: 'org.hibernate', name: 'hibernate-core', version: '5.1.5.Final'
Some further info it gets as far as the StrategySelectorBuilder and fails when calling
applyFromStrategyRegistration( strategySelector, explicitStrategyRegistration );
where the strategyRole is interface org.hibernate.cache.spi.RegionFactory and strategyImplementation is class org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
If we set the hibernate core and ehcache versions to 5.3.* everything works as expected.
However this is not an option as we have a grails project that needs to use hibernate and gorm on;y works with up to version 5.1.5
Any ideas would be greatly appreciated.
Thanks