Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-11361

BeanWrapper fails in case of read/write method mismatch (e.g. EhCacheFactoryBean.setMemoryStoreEvictionPolicy)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.2.6, 4.0 GA
    • Fix Version/s: 3.2.7, 4.0.1
    • Component/s: Caching
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      We have an applicationContext-common-authorization.xml file with the following component:

      <bean id="aclCacheFactory" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
      <property name="cacheManager">
      <ref local="cacheManager"/>
      </property>
      <property name="maxElementsInMemory" value="30000"/>
      <property name="eternal" value="false"/>
      <property name="timeToIdle" value="3600"/>
      <property name="timeToLive" value="7200"/>
      <property name="overflowToDisk" value="false"/>
      <property name="memoryStoreEvictionPolicy" value="LRU"/>
      <property name="diskPersistent" value="false"/>
      <property name="cacheName" value="aclCache"/>
      </bean>

      This fails on memoryStoreEvictionPolicy. I can trace down all the way to ehCache's CacheConfiguration, and all is well. After it returns, though, BeanWrapperImpl:1152 calls:

      writeMethod.invoke(this.object, value);

      The writeMethod accepts a String, but the value passed in is a MemoryStoreEvictionPolicy enum.

      Is this a bug? Or do I simply need to change my configuration (perhaps using memoryStoreEvictionPolicyFromObject instead)?

      This worked fine before our upgrade to Spring 4.

      When I remove the memoryStoreEvictionPolicy line (LRU is the default, anyway), the server starts up normally.

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            mintern Brandon Mintern
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 19 weeks, 5 days ago