无法解决以下错误:
Cannot find class [org.springframework.cache.ehcache.EhCacheCacheManager]
我使用的是 Spring 4.2.4 和 Ehcache 3.1.3。
Maven 依赖项:
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.1.3</version>
</dependency>
Bean 配置:
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager">
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="/WEB-INF/ehcache.xml"/>
</bean>
</property>
</bean>
不确定缺少什么。任何帮助将不胜感激。
最佳答案
您缺少的依赖项是这样的:
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.3.3.RELEASE</version>
如果您发现自己在看到 ClassNotFoundException
时正在寻找正确的依赖项,那么您的第一点应该始终是这样的:
关于java - Spring 4.2 中 EhCacheManager 出现类未找到异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39984492/