Announcement Announcement Module
Collapse
No announcement yet.
EhCaching CompositeCacheManager Error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • EhCaching CompositeCacheManager Error

    I am using Spring 3.1.1. I have the following configuration in my applicationContext.xml to integrate EhCache with Spring.

    HTML Code:
    <!-- START EhCache Configuration -->
    	<cache:annotation-driven cache-manager="cacheManager" proxy-target-class="true"/>
    	
    	<bean id="cacheManager" class="org.springframework.cache.support.CompositeCacheManager" p:fallbackToNoOpCache="true">
    		<property name="cacheManagers">
    			<list>
    				<ref bean="ehCacheManager" />
    			</list>
    		</property>
    	</bean>
    <bean id="ehCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cacheManager-ref="ehCache">
    		<!-- <property name="configLocation" value="/WEB-INF/ehcache.xml" /> -->
    	</bean>
    	
    	<bean id="ehCache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:config-location="/WEB-INF/ehcache.xml" />
    	<!-- END EhCache Configuration -->
    When I run my application I get the following error

    Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExcep tion: Invalid property '
    fallbackToNoOpCache' of bean class [org.springframework.cache.support.CompositeCacheMa nager]: Bean property 'fallbackToNoOpCache' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
    [java] at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1361
    )
    [java] at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1086)
    [java] at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:517)
    [java] at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    [java] at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 95)
    [java] at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    [java] at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:292 )
    [java] at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:194)
    [java] at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:322)
    [java] ... 84 more

    Does anyone know what I am doing wrong? Any help will be appreciated.

  • #2
    This forum is for the Spring Integration Project http://www.springsource.org/spring-integration

    That said, I can't reproduce your problem, fallbackToNoOpCache has a setter of type boolean, and code very similar to yours works fine for me.

    Can you run with debug for org.springframework.* and post the entire bean initialization sequence, and full stack trace, in a zip?

    Comment


    • #3
      Thanks for your quick response Gary. I posted it under Integration because Cache Abstraction is documented under Integration. Sorry about that.

      Find attached the bean initialization sequence and full stack trace as requested.

      Comment


      • #4
        Hi Rosemary,

        Unfortunately, this only has INFO level logs; as I mentioned...

        Can you run with DEBUG for org.springframework.* and post ...
        Spring emits lots of useful diagnostics under DEBUG.

        I am happy to continue to try to help, but you may get a faster response from somebody more familiar with cache here...

        http://forum.springsource.org/forumd...p?26-Container

        Comment

        Working...
        X