Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
Brandon Mintern opened SPR-11361 and commented
We have an applicationContext-common-authorization.xml file with the following component:
<bean id="aclCacheFactory" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<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"/>
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:
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.
Affects: 3.2.6, 4.0 GA
Backported to: 3.2.7
The text was updated successfully, but these errors were encountered:
Juergen Hoeller commented
This turned out to be a problem with BeanWrapperImpl's type resolution in case of inconsistencies between the read and write method of a target property:
In EhCache's case, the getMemoryStoreEvictionPolicy method returns the enum, but setMemoryStoreEvictionPolicy takes a String argument...
As of Spring 4.0.1, we're correctly choosing the write method's argument type for conversion purposes, if there is such a mismatch.
Sorry, something went wrong.
No branches or pull requests