【问题标题】:Spring Unit Testing on EHCacheEHCache 上的 Spring 单元测试
【发布时间】:2013-10-06 14:05:45
【问题描述】:

我已经注释了

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "file:WebContent/WEB-INF/dispatcher-servlet.xml" })

<!-- Start of  EhCache -->
    <cache:annotation-driven />
    <context:component-scan base-package="caching" />
    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cacheManager-ref="ehcache"/>
    <bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" 
     p:configLocation="/WEB-INF/ehcache.xml"  
     p:shared="true"/> 
    <!-- End of EhCache -->

它一直说没有找到ehcache.xml...但是在普通服务器上可以找到它。我可以知道是什么问题吗?

【问题讨论】:

    标签: java spring unit-testing ehcache


    【解决方案1】:

    如果我理解正确,您的 spring 配置和 ehcache 配置都在同一个目录中。所以看来你可以使用p:configLocation="ehcache.xml"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-22
      • 2016-05-28
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多