java.lang.IllegalStateException: An implementation of CacheProviderFacade should be registered under the name 'cacheProvider'

Spring JIRA | Craig Walls | 1 decade ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    When using the <??cache:proxy> configuration element, the "cacheProvider" bean (or the bean referred to by the providerId attribute) must appear in the context XML before the <??cache:proxy> element. For instance, the following will work... <bean id="cacheProvider" class="org.springmodules.cache.provider.ehcache.EhCacheFacade"> <property name="cacheManager" ref="cacheManager" /> </bean> <ehcache:proxy id="slowService" refId="slowServiceTarget" providerId="cacheProvider" > <ehcache:caching methodName="get*" cacheName="firstCache" /> </ehcache:proxy> But this will not work: <ehcache:proxy id="slowService" refId="slowServiceTarget" providerId="cacheProvider" > <ehcache:caching methodName="get*" cacheName="firstCache" /> </ehcache:proxy> <bean id="cacheProvider" class="org.springmodules.cache.provider.ehcache.EhCacheFacade"> <property name="cacheManager" ref="cacheManager" /> </bean> In this case, the following exception/stacktrace is thrown: Exception in thread "main" java.lang.IllegalStateException: An implementation of CacheProviderFacade should be registered under the name 'cacheProvider' at org.springmodules.cache.config.AbstractCacheSetupStrategyParser.parse(AbstractCacheSetupStrategyParser.java:93) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:78) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1087) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:544) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:339) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:314) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:168) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:278) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68) at com.habuma.cache.SlowServiceRunner.main(SlowServiceRunner.java:8)

    Spring JIRA | 1 decade ago | Craig Walls
    java.lang.IllegalStateException: An implementation of CacheProviderFacade should be registered under the name 'cacheProvider'
  2. 0

    When using the <??cache:proxy> configuration element, the "cacheProvider" bean (or the bean referred to by the providerId attribute) must appear in the context XML before the <??cache:proxy> element. For instance, the following will work... <bean id="cacheProvider" class="org.springmodules.cache.provider.ehcache.EhCacheFacade"> <property name="cacheManager" ref="cacheManager" /> </bean> <ehcache:proxy id="slowService" refId="slowServiceTarget" providerId="cacheProvider" > <ehcache:caching methodName="get*" cacheName="firstCache" /> </ehcache:proxy> But this will not work: <ehcache:proxy id="slowService" refId="slowServiceTarget" providerId="cacheProvider" > <ehcache:caching methodName="get*" cacheName="firstCache" /> </ehcache:proxy> <bean id="cacheProvider" class="org.springmodules.cache.provider.ehcache.EhCacheFacade"> <property name="cacheManager" ref="cacheManager" /> </bean> In this case, the following exception/stacktrace is thrown: Exception in thread "main" java.lang.IllegalStateException: An implementation of CacheProviderFacade should be registered under the name 'cacheProvider' at org.springmodules.cache.config.AbstractCacheSetupStrategyParser.parse(AbstractCacheSetupStrategyParser.java:93) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:78) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1087) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:544) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:339) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:314) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:168) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:278) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68) at com.habuma.cache.SlowServiceRunner.main(SlowServiceRunner.java:8)

    Spring JIRA | 1 decade ago | Craig Walls
    java.lang.IllegalStateException: An implementation of CacheProviderFacade should be registered under the name 'cacheProvider'

    Root Cause Analysis

    1. java.lang.IllegalStateException

      An implementation of CacheProviderFacade should be registered under the name 'cacheProvider'

      at org.springmodules.cache.config.AbstractCacheSetupStrategyParser.parse()
    2. spring-modules-cache
      AbstractCacheSetupStrategyParser.parse
      1. org.springmodules.cache.config.AbstractCacheSetupStrategyParser.parse(AbstractCacheSetupStrategyParser.java:93)
      1 frame
    3. Spring Beans
      AbstractBeanDefinitionReader.loadBeanDefinitions
      1. org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:78)
      2. org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1087)
      3. org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
      4. org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
      5. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:544)
      6. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
      7. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:339)
      8. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:314)
      9. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
      10. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
      11. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:168)
      11 frames
    4. Spring Context
      ClassPathXmlApplicationContext.<init>
      1. org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
      2. org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
      3. org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
      4. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:278)
      5. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
      6. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
      7. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68)
      7 frames
    5. com.habuma.cache
      SlowServiceRunner.main
      1. com.habuma.cache.SlowServiceRunner.main(SlowServiceRunner.java:8)
      1 frame