【问题标题】:Spring 3.2 and Cache Abstraction missing EhCache implementationSpring 3.2 和缓存抽象缺少 EhCache 实现
【发布时间】:2012-12-19 15:57:45
【问题描述】:

我正在将我们的代码迁移到 Spring 3.2 版本(来自 3.1.3)并且我遇到了 Spring Cache Abstraction 的问题。

我们使用CacheManager的EhCache实现,其配置非常简单:

<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" />

我的问题是我在spring-context jar 中缺少EhCacheCacheManager 类和相应的工厂bean。我想他们将实现移到了其他模块,但我找不到确切的位置。

【问题讨论】:

  • 你的 bean decalrations 现在是什么样子的?
  • 它们是一样的,我刚刚更新了我的 maven 配置并包含了 spring-context-support 依赖项
  • 哇!谢谢...错过了添加依赖项

标签: spring ehcache


【解决方案1】:

根据Appendix C. Migrating to Spring Framework 3.2

“org.springframework.cache.ehcache 包中的 EHCache 支持类从 spring-context 模块移动到 spring-context-support”。

【讨论】:

    【解决方案2】:

    更新 Maven pom.xml 文件对我有用。

    属性:

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

    依赖关系

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

    【讨论】:

    • 这不是最好的主意,显然正确之后回答了。
    【解决方案3】:

    使用oss.sonatype.org,您可以按名称搜索一个类并找到它包含在哪些工件中,当它们被索引时:https://oss.sonatype.org/index.html#nexus-search;classname~EhCacheCacheManager

    正如 SwapnilS 所回答的,它在 spring-context-support 中。

    【讨论】:

      猜你喜欢
      • 2016-09-23
      • 1970-01-01
      • 1970-01-01
      • 2012-12-12
      • 1970-01-01
      • 1970-01-01
      • 2016-05-05
      • 1970-01-01
      • 2017-09-19
      相关资源
      最近更新 更多