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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Complete
    • 3.2.6, 4.0 GA
    • 3.2.7, 4.0.1
    • Caching
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:
              3 years, 38 weeks, 2 days ago