Spring 3.2 and Cache Abstraction missing EhCache implementation

给你一囗甜甜゛ 提交于 2019-12-18 12:52:54

问题


I am migrating our code to Spring 3.2 version (from 3.1.3) and I've got an issue with Spring Cache Abstraction.

We use EhCache implementation of CacheManager and its configuration is quite simple:

<cache:annotation-driven />

<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cache-manager-ref="ehcache" />
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:config-location="classpath:ehcache.xml" />

My problem is that I am missing EhCacheCacheManager class and corresponding factory bean in spring-context jar. I suppose they moved implementation to some other module, but I can't find where exactly.


回答1:


According to Appendix C. Migrating to Spring Framework 3.2,

"the EHCache support classes in the org.springframework.cache.ehcache package moved from the spring-context module to spring-context-support".




回答2:


Updating the Maven pom.xml file worked for me.

Properties:

    <org.springframework-version>3.2.3.RELEASE</org.springframework-version>

Dependencies

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>${org.springframework-version}</version>
    </dependency>



回答3:


Using oss.sonatype.org, you can search for a class by name and find in which artifacts it's contained, when they are indexed: https://oss.sonatype.org/index.html#nexus-search;classname~EhCacheCacheManager.

As SwapnilS has answered, it's in spring-context-support.



来源:https://stackoverflow.com/questions/13956224/spring-3-2-and-cache-abstraction-missing-ehcache-implementation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!