SpringMVC注解+Hibernate3+Ehcache配置问题汇总

最近研究了下Ehcache的配置,在配置过程中遇到一些问题,然后在网上查了后发现有的资料不准确,现整理一下,分享给大家。

1、Ehcache版本要在1.1以上,否则会报错

tried to access method net.sf.ehcache.CacheManager.<init>(Ljava/io/InputStream;)V from class org.springframework.cache.ehcache.EhCacheManagerFactoryBean

2、NoClassDefFoundError:com/google/common/collect/MapMaker

网上大都说需要Ehcache.jar、ehcache-spring-annotations-1.2.0.jar(这个是用注解的方式配置,如果不用不需要)即可,但是在实际配置中会报NoClassDefFoundError:com/google/common/collect/MapMaker,需要在添加一个guava-r09.jar,下载地址http://code.google.com/p/ehcache-spring-annotations/的lib里有

3、网上搜资料的时候说配了 <ehcache:annotation-driven cache-manager="ehCacheManager" />   之后就不需要配置hibernate.cache.provider_class=true了,答案是否定的!需要配置!

猜你喜欢

转载自fly-ccy.iteye.com/blog/1849883