关于springMVC+hibernate4+eacache二级缓存配置问题,启动一直报错

1、已经成功导入了相关jar包:hibernate-core 4.3.8Final;hibernate-ehcache 4.3.8Final和ehcache2.9.0
2、配置如下
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">



${hibernate.hbm2ddl.auto}
${hibernate.dialect}
${hibernate.show_sql}
${hibernate.format_sql}
none
<!-- 开启查询的二级缓存 如果不需要就不设置 -->

true
<!-- 开启二级缓存 ehcache -->
true

<!-- Hibernate4.0以上设置factory -->

org.hibernate.cache.ehcache.EhCacheRegionFactory
<!-- 二级缓存 ehcache的配置文件位置 -->
classpath:configs/ehcache.xml



其中也注意了hibernate4和3的区别了
3、在实体类以标签注入@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)后,启动项目会报错
4、错误如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'riskalertDao': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory_riskalert' defined in class path resource [configs/spring-data-config.xml]: Invocation of init method failed; nested exception is 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 using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
······
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory_riskalert' defined in class path resource [configs/spring-data-config.xml]: Invocation of init method failed; nested exception is 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 using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
······
Caused by: 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 using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
······
九月 12, 2017 2:58:18 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class com.prosas.basic.utils.ProjectInit
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'riskalertDao': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory_riskalert' defined in class path resource [configs/spring-data-config.xml]: Invocation of init method failed; nested exception is 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 using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
······
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory_riskalert' defined in class path resource [configs/spring-data-config.xml]: Invocation of init method failed; nested exception is 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 using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
······
Caused by: 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 using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
······
5、网上查了很多资料,都说这个错误是org.hibernate.cache.ehcache.EhCacheRegionFactory这行有问题,但是说的解决方法中都是改成这样啊,就是解决不了问题很苦恼,求大神解答!

在线等大神来帮忙啊·································

Hibernate4的配置是下面这样的,你仔细检查一下是不是这样配的

    <property name="hibernate.cache.use_second_level_cache">true</property>  
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>  
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>  

没有大神来看看吗???还是没有解决 刚才缓存问题导致成功了 白高兴一场