java.lang.NullPointerException

Couchbase JIRA | Matt Carabine | 7 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When using the method 'bucket.bucketManager().getDesignDocuments()' when there are non-data nodes present in the cluster causes a null pointer exception to be thrown: {code} Exception in thread "main" java.lang.NullPointerException at com.couchbase.client.java.bucket.DefaultAsyncBucketManager$3.call(DefaultAsyncBucketManager.java:161) at com.couchbase.client.java.bucket.DefaultAsyncBucketManager$3.call(DefaultAsyncBucketManager.java:150) at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:66) at rx.observers.Subscribers$5.onNext(Subscribers.java:229) at rx.internal.producers.SingleProducer.request(SingleProducer.java:65) at rx.Subscriber.setProducer(Subscriber.java:211) at rx.internal.operators.OperatorMap$MapSubscriber.setProducer(OperatorMap.java:99) at rx.Subscriber.setProducer(Subscriber.java:205) at rx.subjects.AsyncSubject.onCompleted(AsyncSubject.java:105) at com.couchbase.client.core.endpoint.AbstractGenericHandler.completeResponse(AbstractGenericHandler.java:348) at com.couchbase.client.core.endpoint.AbstractGenericHandler.access$000(AbstractGenericHandler.java:66) at com.couchbase.client.core.endpoint.AbstractGenericHandler$1.call(AbstractGenericHandler.java:366) at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.core.message.config.GetDesignDocumentsResponse.class at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:109) at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:70) ... 17 more {code} I have attached debug level logging with this failure (NPE_failure.log). Interestingly it only seems to occur if the node that I connect to in my bootstrap list is non-data. If I change my code to bootstrap off of the data node then I don't have this problem, I have attached the log as NPE_success.log. The code to reproduce this is very simple: {code} import com.couchbase.client.java.Bucket; import com.couchbase.client.java.CouchbaseCluster; public class Main { public static void main(String[] args){ Bucket bucket = CouchbaseCluster.create("10.142.150.101").openBucket("beer-sample"); System.out.println(bucket.bucketManager().getDesignDocuments()); } } {code}

    Couchbase JIRA | 7 months ago | Matt Carabine
    java.lang.NullPointerException
  2. 0

    When using the method 'bucket.bucketManager().getDesignDocuments()' when there are non-data nodes present in the cluster causes a null pointer exception to be thrown: {code} Exception in thread "main" java.lang.NullPointerException at com.couchbase.client.java.bucket.DefaultAsyncBucketManager$3.call(DefaultAsyncBucketManager.java:161) at com.couchbase.client.java.bucket.DefaultAsyncBucketManager$3.call(DefaultAsyncBucketManager.java:150) at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:66) at rx.observers.Subscribers$5.onNext(Subscribers.java:229) at rx.internal.producers.SingleProducer.request(SingleProducer.java:65) at rx.Subscriber.setProducer(Subscriber.java:211) at rx.internal.operators.OperatorMap$MapSubscriber.setProducer(OperatorMap.java:99) at rx.Subscriber.setProducer(Subscriber.java:205) at rx.subjects.AsyncSubject.onCompleted(AsyncSubject.java:105) at com.couchbase.client.core.endpoint.AbstractGenericHandler.completeResponse(AbstractGenericHandler.java:348) at com.couchbase.client.core.endpoint.AbstractGenericHandler.access$000(AbstractGenericHandler.java:66) at com.couchbase.client.core.endpoint.AbstractGenericHandler$1.call(AbstractGenericHandler.java:366) at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.core.message.config.GetDesignDocumentsResponse.class at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:109) at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:70) ... 17 more {code} I have attached debug level logging with this failure (NPE_failure.log). Interestingly it only seems to occur if the node that I connect to in my bootstrap list is non-data. If I change my code to bootstrap off of the data node then I don't have this problem, I have attached the log as NPE_success.log. The code to reproduce this is very simple: {code} import com.couchbase.client.java.Bucket; import com.couchbase.client.java.CouchbaseCluster; public class Main { public static void main(String[] args){ Bucket bucket = CouchbaseCluster.create("10.142.150.101").openBucket("beer-sample"); System.out.println(bucket.bucketManager().getDesignDocuments()); } } {code}

    Couchbase JIRA | 7 months ago | Matt Carabine
    java.lang.NullPointerException

    Root Cause Analysis

    1. rx.exceptions.OnErrorThrowable$OnNextValue

      OnError while emitting onNext value: com.couchbase.client.core.message.config.GetDesignDocumentsResponse.class

      at rx.exceptions.OnErrorThrowable.addValueAsLastCause()
    2. rxjava
      Subscribers$5.onNext
      1. rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:109)
      2. rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:70)
      3. rx.observers.Subscribers$5.onNext(Subscribers.java:229)
      3 frames
    3. rx.internal.producers
      SingleProducer.request
      1. rx.internal.producers.SingleProducer.request(SingleProducer.java:65)
      1 frame
    4. rxjava
      AsyncSubject.onCompleted
      1. rx.Subscriber.setProducer(Subscriber.java:211)
      2. rx.internal.operators.OperatorMap$MapSubscriber.setProducer(OperatorMap.java:99)
      3. rx.Subscriber.setProducer(Subscriber.java:205)
      4. rx.subjects.AsyncSubject.onCompleted(AsyncSubject.java:105)
      4 frames
    5. com.couchbase.client
      AbstractGenericHandler$1.call
      1. com.couchbase.client.core.endpoint.AbstractGenericHandler.completeResponse(AbstractGenericHandler.java:348)
      2. com.couchbase.client.core.endpoint.AbstractGenericHandler.access$000(AbstractGenericHandler.java:66)
      3. com.couchbase.client.core.endpoint.AbstractGenericHandler$1.call(AbstractGenericHandler.java:366)
      3 frames
    6. rxjava
      ScheduledAction.run
      1. rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
      1 frame
    7. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      4. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      5. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      6. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      7. java.lang.Thread.run(Thread.java:745)
      7 frames