caching - "client not initialized" error when using SSMCache with AWS elasticache autodiscovery -
i using spring cache aws elasticache provider. warning:
warn c.g.code.ssm.spring.ssmcache - error has occurred cache defaultcache , key java.lang.illegalstateexception: client not initialized @ net.spy.memcached.memcachedclient.checkstate(memcachedclient.java:1623) ~[elasticache-java-cluster-client.jar:na] @ net.spy.memcached.memcachedclient.enqueueoperation(memcachedclient.java:1617) ~[elasticache-java-cluster-client.jar:na] @ net.spy.memcached.memcachedclient.asyncget(memcachedclient.java:1013) ~[elasticache-java-cluster-client.jar:na] @ net.spy.memcached.memcachedclient.get(memcachedclient.java:1235) ~[elasticache-java-cluster-client.jar:na] @ net.spy.memcached.memcachedclient.get(memcachedclient.java:1256) ~[elasticache-java-cluster-client.jar:na] @ com.google.code.ssm.providers.elasticache.memcacheclientwrapper.get(memcacheclientwrapper.java:147) ~[aws-elasticache-provider.jar:na] @ com.google.code.ssm.cacheimpl.get(cacheimpl.java:271) ~[simple-spring-memcached.jar:na] @ com.google.code.ssm.cacheimpl.get(cacheimpl.java:106) ~[simple-spring-memcached.jar:na] @ com.google.code.ssm.spring.ssmcache.getvalue(ssmcache.java:226) [spring-cache.jar:na] @ com.google.code.ssm.spring.ssmcache.get(ssmcache.java:100) [spring-cache.jar:na] i using same memcache without spring cache , works fine. error when use spring cache.
i have verified security groups has inbound port specified , running code on ec2.
update 1:
adding config -
<bean name="cachemanager" class="com.google.code.ssm.spring.ssmcachemanager"> <property name="caches"> <set> <bean class="com.google.code.ssm.spring.ssmcache"> <constructor-arg name="cache" index="0" ref="defaultmemcachedclient" /> <!-- 5 minutes --> <constructor-arg name="expiration" index="1" value="3600" /> <!-- @cacheevict(..., "allentries" = true) won't work because allowclear false, won't flush accidentally entries memcached instance --> <constructor-arg name="allowclear" index="2" value="false" /> </bean> </set> </property> </bean> <bean name="defaultmemcachedclient" class="com.google.code.ssm.cachefactory"> <property name="cachename" value="defaultcache" /> <property name="cacheclientfactory"> <bean name="cacheclientfactory" class="com.google.code.ssm.providers.elasticache.memcacheclientfactoryimpl" /> </property> <property name="addressprovider"> <bean class="com.google.code.ssm.config.defaultaddressprovider"> <property name="address" value="127.0.0.1:11211" /> </bean> </property> <property name="configuration"> <bean class="com.google.code.ssm.providers.elasticache.elasticacheconfiguration"> <property name="consistenthashing" value="true" /> <property name="clientmode" value="#{t(net.spy.memcached.clientmode).dynamic}" /> </bean> </property> </bean>
show configuration , usage.
it seams haven't defined defaultcache or used cacheable without 'value' param set.
Comments
Post a Comment