Not able to Decode Legacy data with 2.0.1 client


#1

Hi,
I have upgraded Java Client to 2.0.1 and Couchbase server 3.0.1.

The data was inserted by dot net client which was already there in the bucket before upgrade.
With version 1.3.2 client i was able to retrieve the data just by

couchbaseClient.get("id");

After java client upgrade to 2.0.1, i have tried

bucket.get(key); // did not worked
bucket.get(key, JsonArrayDocument.class); // did not worked

the data format is

key = "k1"
value =
[
  "0:999999999"
]

when i debug i have noticed the flags=274 (not sure about this)
Please help. Thanks in advance.

Exception stack trace:
com.couchbase.client.java.error.TranscodingException: Flags (0x112) indicate non-JSON document for id k1, could not decode.
        at com.couchbase.client.java.transcoder.JsonTranscoder.doDecode(JsonTranscoder.java:60)
        at com.couchbase.client.java.transcoder.JsonTranscoder.doDecode(JsonTranscoder.java:40)
        at com.couchbase.client.java.transcoder.AbstractTranscoder.decode(AbstractTranscoder.java:42)
        at com.couchbase.client.java.CouchbaseAsyncBucket$1.call(CouchbaseAsyncBucket.java:136)
        at com.couchbase.client.java.CouchbaseAsyncBucket$1.call(CouchbaseAsyncBucket.java:132)
        at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:54)
        at rx.internal.operators.OperatorFilter$1.onNext(OperatorFilter.java:54)
        at rx.internal.operators.OperatorSubscribeOn$1$1$1.onNext(OperatorSubscribeOn.java:76)
        at rx.subjects.SubjectSubscriptionManager$SubjectObserver.onNext(SubjectSubscriptionManager.java:224)
        at rx.subjects.AsyncSubject.onCompleted(AsyncSubject.java:101)
        at com.couchbase.client.core.ResponseHandler.onEvent(ResponseHandler.java:95)
        at com.couchbase.client.core.ResponseHandler.onEvent(ResponseHandler.java:43)
        at com.couchbase.client.deps.com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
        at java.lang.Thread.run(Thread.java:781)
Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.core.message.kv.GetResponse.class
        at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:98)
        at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:56)
        ... 11 more

#2

Yes, that kind of makes sense that it breaks. The legacy .NET client is not compatible with the 2.0 SDK of Java. You can write a custom transcoder and document type to make that happen though, I wonder why it works with the 1.3 SDK, since the flag is also different.

Can you tell me all the doc types (with flags) you need to read from the .NET sdk? I can write you a simple example to make that happen then. Also, do you need to write (so read/write together with the .NET sdk?)

Thanks,
Michael


#3

Hi,
We are inserting following type of data:

  1. Simple string
  2. Array of strings
    I am not sure about the flags value for these.

Can you please provide me the sample example for this.

Thanks in advance.


#4

Are the Strings and array of Strings JSON compatible or a different format?

@jmorris can you help identifying the flags maybe?


#5

They are Json compatible.


#6

@daschl @shivayemula .NET 1.3.X treats JSON as a simple UTF8 string. The serialization/deserialization is done after the fact when you use one of the extension methods to do the conversion.

-Jeff