一般org.springframework.cache.ehcache.EhCacheCacheManager和org.springframework.cache.ehcache.EhCacheManagerFactoryBean會同時找不到。
解決方法很簡單,在pom.xml裏引入這個依賴即可:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework.version}</version>
</dependency>
把其中的${org.springframework.version}
換成你的版本,或者在properties裏聲明這個屬性。比如我這裏:
<properties>
<org.springframework.version>4.0.7.RELEASE</org.springframework.version>
</properties>