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

Misleading exception when replica server not found

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.1.2
    • Component/s: Core
    • Security Level: Public
    • Labels:
      None

      Description

      If the number of Couchbase servers is not enough to provide the required number of replicas (e.g. when installing a stand-alone server and forgetting to uncheck the 'Enable replicas' option), observe throws an ArrayIndexOutOfBoundsException. An exception with a more descriptive name would indicate the error cause more clearly.

      An example stack trace:

      ArrayIndexOutOfBoundsException: -1
      java.util.ArrayList.elementData(ArrayList.java:371)
      java.util.ArrayList.get(ArrayList.java:384)
      com.couchbase.client.vbucket.config.DefaultConfig.getServer(DefaultConfig.java:81)
      com.couchbase.client.vbucket.VBucketNodeLocator.getServerByIndex(VBucketNodeLocator.java:112)
      com.couchbase.client.CouchbaseClient.observe(CouchbaseClient.java:1621)
      com.couchbase.client.CouchbaseClient.observePoll(CouchbaseClient.java:1750)
      com.couchbase.client.CouchbaseClient.set(CouchbaseClient.java:1199)
      ...

        Issue Links

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

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              daschl Michael Nitschinger
              Reporter:
              schp schp
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes