Unable to use couchclient version above 1.1.7 & above for memcache buckets

Hi Team,

In addition if I use 1.1.6 couch client version then I am getting class cast exception

ava.lang.ClassCastException: com.couchbase.client.CouchbaseMemcachedConnection cannot be cast to com.couchbase.client.CouchbaseConnection
at com.couchbase.client.CouchbaseClient.observePoll(CouchbaseClient.java:1708)
at com.couchbase.client.CouchbaseClient.add(CouchbaseClient.java:1293)

I am trying use couchclient 1.1.7 and above to store in memcache buckets but getting the following exception.

However, 1.1.6 client works fine with 2.2 couchserver but facing such issues with 2.1 . Can you pl assist in this regard.

Requirement is work on Version: 2.1.0 enterprise edition (build-718) couch server, any client version is ok.

DEBUG [2013-11-06 17:00:22.636] [localhost-startStop-1]: org.fwcms.iam.common.MorphiaTemplate - destroying the Mongo Object
ERROR [2013-11-06 17:00:22.671] [localhost-startStop-1]: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchCacheManager' defined in URL [jar:file:/home/tomcat/apache-tomcat-7.0.42/webapps/iam-cache/WEB-INF/lib/iam-cache-services-1.0.0.jar!/org/fwcms/iam/managers/impl/CouchCacheManager.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Durability options are not supported on memcached type buckets.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalArgumentException: Durability options are not supported on memcached type buckets.
at com.couchbase.client.CouchbaseClient.set(CouchbaseClient.java:1115)
at com.couchbase.client.CouchbaseClient.set(CouchbaseClient.java:1181)
at org.fwcms.iam.common.BaseDAO.saveInBulk(BaseDAO.java:633)
at org.fwcms.iam.dao.impl.CouchCacheDAO.saveUserRolesInBulk(CouchCacheDAO.java:87)
at org.fwcms.iam.managers.impl.CouchCacheManager.loadUserRoleDataToCouchCache(CouchCacheManager.java:160)
at org.fwcms.iam.managers.impl.CouchCacheManager.afterPropertiesSet(CouchCacheManager.java:871)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 26 more

1 Answer

« Back to question.

Hello

Based on the exception that I see, it is not related to the SDK version but more about the way you use the SDK. See this message:

Caused by: java.lang.IllegalArgumentException: Durability options are not supported on memcached type buckets. 

This makes sense since you are using a Memcached bucket and you do not have any replication or persistence. So check you code and remove the "ReplicatedTo" and/or "PersistedTo" options.

Regards
Tug
@tgrall

Hi Tug,

Does it mean memcache does not support replication ? But we do need replication and I had have two entries of pools available and provided.

Thanks,
Yashwanth