Results 1 to 4 of 4

Thread: EhCaching CompositeCacheManager Error

  1. #1
    Join Date
    Apr 2012
    Posts
    2

    Default 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. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,040

    Default

    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?
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Apr 2012
    Posts
    2

    Default

    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.
    Attached Files Attached Files

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,040

    Default

    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
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •