Spring boot and Hibernate Second Level cache giving NoCacheRegionFactoryAvailableException

Problem:

Setting below in application.properties,

hibernate.cache.use_second_level_cache=true
hibernate.cache.hazelcast.use_native_client=true
hibernate.cache.region.factory_class=com.hazelcast.hibernate.HazelcastCacheRegionFactory

Gives the error:


org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the
application, but property hibernate.cache.region.factory_class is not given, please either
disable second level cache or set correct region factory class name to property
hibernate.cache.region.factory_class (and make sure the second level cache provider,
hibernate-infinispan, for example, is available in the classpath).

Solution

Move the above settings from application.properties to hibernate.properties.

🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

53,709 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>