测试二级缓存中出现的一个错误如下。
Caused by: org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_classis not gaven, 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, available in the classpath).
将
<property name="cache.provider_class">org.hibernate.cache.internal.EhCacheProvider</property>
改成
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>
即可。