I would like to setup spring method caching backed up by Gemfire, the spring bean cache configuration is read as bellow :
<gfe:cache id="simple" properties-ref="props" />
<util:properties id="props" location="classpath:cache.properties"/>
<gfe:transaction-manager cache-ref="simple" />
</gfe:replicated-region>
<gfe:replicated-region id="gestionReferentielCacheModel" cache-ref="simple">
</gfe:replicated-region>
<cache:annotation-driven />
<bean id="cacheManager" class="org.springframework.data.gemfire.support.GemfireCacheManager" p:cache-ref="simple"/>
cache.properties :
locators=localhost[55221]
RecupererDroitsSMImpl.java :
@Servicepublicclass RecupererDroitsSMImpl implements RecupererDroitsSM{
@Cacheable(value="gestionAccesCacheModel")
public List<HabilitationCollege> recupererDroitsByUsers(String utilisateur,String abonnement) {
....................................
}
}
pom.xml :
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-gemfire</artifactId>
<scope>system</scope>
<systemPath>D:/repository/spring-data-gemfire-1.3.0.RELEASE.jar</systemPath>
</dependency>
<dependency>
<groupId>com.gemstone.gemfire</groupId>
<artifactId>gemfire</artifactId>
<version>6.6.2</version>
</dependency>
I get the following exception:
com/socgen/cmc/service/metier/international/habilitation/RecupererDroitsSMImpl.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in ServletContext resource [/WEB-INF/conf/commun/cmc-commun-cache.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: loadCaches must not return an empty Collection
Any Help should be appreciated
thanks