Uploaded image for project: 'Spring Modules'
  1. Spring Modules
  2. MOD-373

AbstractCachingInterceptor.setCachingModels(Map m) only works if m is a java.util.Properties

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.8
    • Fix Version/s: None
    • Component/s: CACHE
    • Labels:
      None
    • Environment:
      JDK 1.5.0_11, Spring 2.0.6

      Description

      AbstractCachingInterceptor.setCachingModels(Map m) only works if m is a java.util.Properties.

      Passing the bean below works:

      <bean id="cachingModels" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
      <property name="properties">
      <props>
      <prop key="productsCaching">cacheName=PRODUCTS_CACHE</prop>
      </props>
      </property>
      </bean>

      But this one not:

      <bean id="cachingModels" class="org.springframework.beans.factory.config.MapFactoryBean">
      <property name="sourceMap">
      <map>
      <entry key="productsCaching">
      <value>cacheName=PRODUCTS_CACHE</value>
      </entry>
      </map>
      </property>
      </bean>

      And it result in the following Exception.

      Caused by: org.springmodules.cache.FatalCacheException: Unable to validate caching model with id 'productsCaching'; nested exception is org.springmodules.cache.provider.InvalidCacheModelException: The caching model should be an instance of <org.springmodules.cache.provider.ehcache.EhCacheCachingModel>
      Caused by: org.springmodules.cache.provider.InvalidCacheModelException: The caching model should be an instance of <org.springmodules.cache.provider.ehcache.EhCacheCachingModel>
      at org.springmodules.cache.provider.AbstractCacheModelValidator.validateCachingModel(AbstractCacheModelValidator.java:37)
      at org.springmodules.cache.interceptor.caching.AbstractCachingInterceptor.validateModels(AbstractCachingInterceptor.java:208)
      at org.springmodules.cache.interceptor.caching.AbstractCachingInterceptor.afterPropertiesSet(AbstractCachingInterceptor.java:72)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)

      A similar problem happens with setFlushingModels.

        Attachments

          Activity

            People

            Assignee:
            irbouho Omar Irbouh
            Reporter:
            ziba Eduardo Issao Ito
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: