Results 1 to 10 of 10

Thread: Caching in SpringModules 0.3

  1. #1

    Default Caching in SpringModules 0.3

    It not working fo me.
    my code:
    Code:
    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
            <property name="configLocation">
                <value>classpath:ehcache.xml</value>
            </property>
        </bean>
    
        <bean id="cacheProviderFacade" class="org.springmodules.cache.provider.ehcache.EhCacheFacade">
            <property name="cacheManager" ref="cacheManager"/>
        </bean>
    
    
        <bean id="cachingAttributeSource" class="org.springmodules.cache.annotations.AnnotationCachingAttributeSource" />
    
        <bean id="cachingInterceptor"
          class="org.springmodules.cache.interceptor.caching.MetadataCachingInterceptor">
          <property name="cacheProviderFacade" ref="cacheProviderFacade" />
          <property name="cachingAttributeSource" ref="cachingAttributeSource" />
          <property name="cacheKeyGenerator" ref="cacheKeyGenerator" />
          <!--property name="cachingListeners">
            <list>
              <ref bean="cachingListener" />
            </list>
          </property-->
          <property name="cachingModels">
            <props>
              <prop key="methodCaching">cacheName=methodCache</prop>
            </props>
          </property>
        </bean>
    
        <bean id="cachingAttributeSourceAdvisor"
          class="org.springmodules.cache.interceptor.caching.CachingAttributeSourceAdvisor">
          <constructor-arg ref="cachingInterceptor" />
        </bean>
    
        <bean id="flushingAttributeSource"
          class="org.springmodules.cache.annotations.AnnotationFlushingAttributeSource">
        </bean>
    
        <bean id="flushingInterceptor"
          class="org.springmodules.cache.interceptor.flush.MetadataFlushingInterceptor">
          <property name="cacheProviderFacade" ref="cacheProviderFacade" />
          <property name="flushingAttributeSource" ref="flushingAttributeSource" />
          <property name="flushingModels">
            <props>
              <prop key="methodFlushing">cacheNames=methodCache</prop>
            </props>
          </property>
        </bean>
    
        <bean id="flushingAttributeSourceAdvisor"
          class="org.springmodules.cache.interceptor.flush.FlushingAttributeSourceAdvisor">
          <constructor-arg ref="flushingInterceptor" />
        </bean>
    
        <bean id="cacheKeyGenerator" class="org.springmodules.cache.key.HashCodeCacheKeyGenerator" />

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    What exactly did not work? Can you turn on logging and post the relevant messages?
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3

    Default

    Tha cache is empty. I don'i know which messages I can post.

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    For example that one that are executed when the method is intercepted and that then take into account populating the cache.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5

    Default

    My log is clear. Nothing was loged in debug level from springmodules.

  6. #6
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    I think you have some configuration problem - take a look at the source code from cache module - it does contain logging. Either your logging is not turned on or for some reason you don't actually use the cache module (and thus no logging appears).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  7. #7
    Join Date
    May 2006
    Posts
    2

    Smile EHCache problem?

    Hi, the class org.springframework.cache.ehcache.EhCacheManagerFa ctoryBean does not exist in springmodules-cache.jar when I dowanloaded from https://springmodules.dev.java.net/

    how can I get the spring modules v0.3 completely, thanks.

  8. #8
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    In 0.3 the EhCacheManagerFactoryBean has been refactored into org.springmodules.cache.provider.ehcache.EhCacheFa cade.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  9. #9

    Default

    This is my log:

    org.springmodules.cache.interceptor.caching.Metada taCachingInterceptor
    Unable to perform caching. No model is associated to the intercepted method <handleRequest>

    what is it?

  10. #10

    Default

    And my config:

    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheMa nagerFactoryBean">
    <property name="configLocation">
    <value>classpath:ehcache.xml</value>
    </property>
    </bean>

    <bean class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
    <property name="beanNames">
    <list>
    <idref bean="adminUserStatController"/>
    </list>
    </property>
    <property name="interceptorNames">
    <list>
    <value>cachingInterceptor</value>
    <value>flushingInterceptor</value>
    </list>
    </property>
    </bean>

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

    <bean id="cachingAttributeSource" class="org.springmodules.cache.annotations.Annotat ionCachingAttributeSource"/>

    <bean id="cachingInterceptor" class="org.springmodules.cache.interceptor.caching .MetadataCachingInterceptor">
    <property name="cacheProviderFacade" ref="cacheProviderFacade"/>
    <property name="cachingAttributeSource" ref="cachingAttributeSource"/>
    <property name="cachingModels">
    <props>
    <prop key="methodCaching">cacheName=methodCache</prop>
    </props>
    </property>
    </bean>

    <bean id="cachingAttributeSourceAdvisor"
    class="org.springmodules.cache.interceptor.caching .CachingAttributeSourceAdvisor">
    <constructor-arg ref="cachingInterceptor"/>
    </bean>

    <bean id="flushingAttributeSource"
    class="org.springmodules.cache.annotations.Annotat ionFlushingAttributeSource">
    </bean>

    <bean id="flushingInterceptor"
    class="org.springmodules.cache.interceptor.flush.M etadataFlushingInterceptor">
    <property name="cacheProviderFacade" ref="cacheProviderFacade"/>
    <property name="flushingAttributeSource" ref="flushingAttributeSource"/>
    <property name="flushingModels">
    <props>
    <prop key="methodFlushing">cacheNames=methodCache</prop>
    </props>
    </property>
    </bean>

    <bean id="flushingAttributeSourceAdvisor"
    class="org.springmodules.cache.interceptor.flush.F lushingAttributeSourceAdvisor">
    <constructor-arg ref="flushingInterceptor"/>
    </bean>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •