Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-223

Cannot use Persist.ONE/MASTER on a single node installation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0, 1.1.1
    • Fix Version/s: 1.1.2
    • Component/s: Core
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Couchbase 2.0.0 Single node installation

      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

        Issue Links

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              daschl Michael Nitschinger
              Reporter:
              tgrall Tug Grall (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes