[JCBC-250] ClassCast Exception when using durability against memcached bucket Created: 20/Feb/13  Updated: 05/Nov/13  Resolved: 18/Jul/13

Status: Resolved
Project: Couchbase Java Client
Component/s: Core
Affects Version/s: 1.1.2
Fix Version/s: 1.1.7
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Michael Nitschinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File 1.1.5-sdk.log     Text File 1.1.6-sdk.log    

 Description   
Apparently trying to use these operations:
CouchbaseClient.add(String key, int exp, String value, PersistTo req, ReplicateTo rep)

Against a memcached bucket causes an exception even if "req" and "rep" are set to 0. From the user's perspective, they expect this to work. Is it a major undertaking to make the classes compatible from the client side, independent of the bucket types and then let the operation succeed/fail when it can or can't?

java.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)

 Comments   
Comment by Deepti Dawar [ 14/May/13 ]
This problem has been fixed in the version 1.1.6. It was there till 1.1.5 but now has been fixed.

Please find the same log of run in 1.1.5 and 1.1.6 to strengthen the findings.

Its good to close.

Thanks !
Comment by Michael Nitschinger [ 27/May/13 ]
This is not fixed. Will make sure to fix it for 1.1.7
Comment by Michael Nitschinger [ 27/May/13 ]
Deepti, for simple cases like this, SDKQE is overkill.

      CouchbaseClient client = new CouchbaseClient(Arrays.asList(new URI("http://127.0.0.1:8091/pools")), "memcache", "");

    client.set("foo", "bar", PersistTo.MASTER);
    
    client.shutdown();

this shows the problem against a memcache bucket.
Comment by Michael Nitschinger [ 27/May/13 ]
http://review.couchbase.com/#/c/26541/
Comment by Michael Nitschinger [ 18/Jul/13 ]
woops, this has been fixed some time ago already.
Comment by Karthik PV [ 05/Nov/13 ]
Hi. I am still getting the same issue with Version 2.1. Interestingly, this does not happen with 2.2
Comment by Michael Nitschinger [ 05/Nov/13 ]
Hm, I'm not sure to which versions you relate to, because thats not dependend on the server.

Can you share the exception? and the couchbase java client version you are using?
Comment by Karthik PV [ 05/Nov/13 ]
HI Michael. We are using 1.1.6 java client. Still it works with 2.2 and not with 2.1?
Comment by Michael Nitschinger [ 05/Nov/13 ]
No, this should not be the problem here, something else is going on.

You need to upgrade to 1.1.7 to have this fixed!

Although I'd recommend you to go straight to 1.2.2. which will be released this week.
Comment by Karthik PV [ 05/Nov/13 ]
What's the latest stable version? Have a Go-Live this week and this is a potential SHOW-Stopper :)
Comment by Michael Nitschinger [ 05/Nov/13 ]
as of now the latest stable is 1.2.1, but we'll release 1.2.2 this week.

If you just want to fix this one issue go to 1.1.7 ;)
Comment by Karthik PV [ 05/Nov/13 ]
Thanks a lot Michael for the help and the super-quick response!
Generated at Wed Apr 23 03:13:55 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.