Details
Description
Using the default bucket I am trying to use the simple "Durability" option using the following code:
{ System.out.println("Set a Key-Value and Get the Key-Value"); OperationFuture op = cb.set("mytest", 0, "my value", PersistTo.MASTER); System.out.println("cb.get(\"mytest\")" + " => " + cb.get("mytest") + "\""); System.out.println(""); }
This raises the following exception:
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.get(ArrayList.java:324)
at com.couchbase.client.vbucket.config.DefaultConfig.getServer(DefaultConfig.java:81)
at com.couchbase.client.vbucket.VBucketNodeLocator.getServerByIndex(VBucketNodeLocator.java:112)
at com.couchbase.client.CouchbaseClient.observe(CouchbaseClient.java:1601)
at com.couchbase.client.CouchbaseClient.observePoll(CouchbaseClient.java:1730)
at com.couchbase.client.CouchbaseClient.set(CouchbaseClient.java:1179)
at com.couchbase.client.CouchbaseClient.set(CouchbaseClient.java:1211)
at com.couchbase.devday.Ex02Storage.main(Ex02Storage.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
I am using the code available at :
https://github.com/couchbaselabs/DeveloperDay
https://github.com/couchbaselabs/DeveloperDay/blob/master/Java/basic-operations/src/main/java/com/couchbase/devday/Ex08Observe.java
(this example does not contain the PersistTo.ONE or MASTER since it does not work on a single node.
but as you can see this is a very basic sample code
Attachments
Issue Links
- is duplicated by
-
JCBC-181 Misleading exception when replica server not found
- Resolved