Spring模块缓存不工作。。。默默地

Spring模块缓存不工作。。。默默地,spring,caching,ehcache,spring-modules,Spring,Caching,Ehcache,Spring Modules,我试图使用Spring模块项目中的声明性缓存 它不起作用,也就是说,似乎没有缓存任何内容 以下是我的配置: <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> </bean> <bean id="cacheProviderFacade" class="org.springmodules.cache.provider.ehca

我试图使用Spring模块项目中的声明性缓存

它不起作用,也就是说,似乎没有缓存任何内容

以下是我的配置:

<bean id="cacheManager"
  class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
</bean>

<bean id="cacheProviderFacade"
  class="org.springmodules.cache.provider.ehcache.EhCacheFacade">
  <property name="cacheManager" ref="cacheManager" />
</bean>

<bean id="cacheableService"
    class="org.springmodules.cache.interceptor.proxy.CacheProxyFactoryBean">
    <property name="cacheProviderFacade" ref="cacheProviderFacade" />
    <property name="cachingModels">
        <props>
            <prop key="get*">cacheName=default</prop>
        </props>
    </property>
    <property name="flushingModels">
        <props>
            <prop key="update*">cacheNames=default</prop>
        </props>
    </property>
    <property name="target" ref="myServiceBean" />
</bean>

在此之后,我访问了一个页面,该页面调用了“myServiceBean”bean中前缀为“get”的方法。但是,没有记录任何正在进行的缓存。我已经将日志记录一直转到了SpringModule的调试、spring的缓存包和调试。。。由于Spring模块的示例在web上非常少,我想知道以前是否有人见过它…

您应该为您的配置创建一个ehcache.xml文件,因为我认为故障保护缓存不能与声明性缓存一起工作。我们使用ehcache-Spring模块XML模式和注释设置缓存。如果使用显式的ehcache.xml不能解决您的问题,那么我可以挖掘一些代码来解决您的问题。

我是一个新项目的作者之一,该项目旨在通过注释为Spring 3项目提供ehcache集成:

该库按照Spring的@Transactional精神提供了两个方法级注释:

@可缓存 @触发器移动

在Spring应用程序中进行适当配置后,此项目将在运行时围绕@Cacheable注释方法创建缓存特性


可以在project wiki上找到使用说明文件

我从未尝试过,抱歉!最后转到另一个项目。
24 Feb 2009 14:26:20,785 INFO    org.springframework.cache.ehcache.EhCacheManagerFactoryBean - Initializing EHCache CacheManager
24 Feb 2009 14:26:20,801 DEBUG net.sf.ehcache.CacheManager - Configuring ehcache from classpath.
24 Feb 2009 14:26:20,801 WARN  net.sf.ehcache.config.ConfigurationFactory - No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: zip:C:/bea/weblogic81/server/bin/myserver/.wlnotdelete/extract/myserver_threeoneoneonline_threeoneoneonline/jarfiles/WEB-INF/lib/ehcache-1.3.0.jar!/ehcache-failsafe.xml
24 Feb 2009 14:26:20,801 DEBUG net.sf.ehcache.config.ConfigurationFactory - Configuring ehcache from URL: zip:C:/bea/weblogic81/server/bin/myserver/.wlnotdelete/extract/myserver_threeoneoneonline_threeoneoneonline/jarfiles/WEB-INF/lib/ehcache-1.3.0.jar!/ehcache-failsafe.xml
24 Feb 2009 14:26:20,801 DEBUG net.sf.ehcache.config.ConfigurationFactory - Configuring ehcache from InputStream
24 Feb 2009 14:26:20,816 DEBUG net.sf.ehcache.config.DiskStoreConfiguration - Disk Store Path: C:\DOCUME~1\bpapa\LOCALS~1\Temp\
24 Feb 2009 14:26:20,832 DEBUG net.sf.ehcache.config.ConfigurationHelper - No CacheManagerEventListenerFactory class specified. Skipping...
24 Feb 2009 14:26:20,832 DEBUG net.sf.ehcache.config.ConfigurationHelper - No CachePeerListenerFactoryConfiguration specified. Not configuring a CacheManagerPeerListener.
24 Feb 2009 14:26:20,847 DEBUG net.sf.ehcache.config.ConfigurationHelper - No CachePeerProviderFactoryConfiguration specified. Not configuring a CacheManagerPeerProvider.
24 Feb 2009 14:26:20,863 DEBUG net.sf.ehcache.config.ConfigurationHelper - No BootstrapCacheLoaderFactory class specified. Skipping...