java.lang.NullPointerException

JIRA | Andy MacKinlay | 2 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    I get an NPE in a very weird place on the cluster at my work: {code} Job aborted due to stage failure: Task 0 in stage 1.0 failed 1 times, most recent failure: Lost task 0.0 in stage 1.0 (TID 230, spark01.example.com): java.lang.NullPointerException at com.mongodb.hadoop.output.MongoRecordWriter.write(MongoRecordWriter.java:115) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12$$anonfun$apply$4.apply$mcV$sp(PairRDDFunctions.scala:1036) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12$$anonfun$apply$4.apply(PairRDDFunctions.scala:1034) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12$$anonfun$apply$4.apply(PairRDDFunctions.scala:1034) at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1285) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12.apply(PairRDDFunctions.scala:1042) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12.apply(PairRDDFunctions.scala:1014) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:63) at org.apache.spark.scheduler.Task.run(Task.scala:70) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:213) 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) Driver stacktrace: {code} This only occurs when I run Spark with master {{yarn-cluster}}. With master {{local}} it runs fine. As noted above, the cluster uses GPFS/ Here's the snippet from my Scala object which does the DB writing {code:scala} private def applyResultRDD(resultRDD: RDD[(BSONObject, BSONObject)]) = { val outputConfig = new Configuration() if (Option(authUri.getUserInfo).isDefined) outputConfig.set("mongo.auth.uri", authUri.toString) outputConfig.set("mongo.output.uri", outputCollUri.toString) resultRDD.saveAsNewAPIHadoopFile("file:///UNUSED", classOf[BSONObject], classOf[BSONObject], classOf[MongoOutputFormat[BSONObject, BSONObject]], outputConfig) } {code}

    JIRA | 2 years ago | Andy MacKinlay
    java.lang.NullPointerException
  2. 0

    I get an NPE in a very weird place on the cluster at my work: {code} Job aborted due to stage failure: Task 0 in stage 1.0 failed 1 times, most recent failure: Lost task 0.0 in stage 1.0 (TID 230, spark01.example.com): java.lang.NullPointerException at com.mongodb.hadoop.output.MongoRecordWriter.write(MongoRecordWriter.java:115) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12$$anonfun$apply$4.apply$mcV$sp(PairRDDFunctions.scala:1036) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12$$anonfun$apply$4.apply(PairRDDFunctions.scala:1034) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12$$anonfun$apply$4.apply(PairRDDFunctions.scala:1034) at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1285) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12.apply(PairRDDFunctions.scala:1042) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12.apply(PairRDDFunctions.scala:1014) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:63) at org.apache.spark.scheduler.Task.run(Task.scala:70) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:213) 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) Driver stacktrace: {code} This only occurs when I run Spark with master {{yarn-cluster}}. With master {{local}} it runs fine. As noted above, the cluster uses GPFS/ Here's the snippet from my Scala object which does the DB writing {code:scala} private def applyResultRDD(resultRDD: RDD[(BSONObject, BSONObject)]) = { val outputConfig = new Configuration() if (Option(authUri.getUserInfo).isDefined) outputConfig.set("mongo.auth.uri", authUri.toString) outputConfig.set("mongo.output.uri", outputCollUri.toString) resultRDD.saveAsNewAPIHadoopFile("file:///UNUSED", classOf[BSONObject], classOf[BSONObject], classOf[MongoOutputFormat[BSONObject, BSONObject]], outputConfig) } {code}

    JIRA | 2 years ago | Andy MacKinlay
    java.lang.NullPointerException
  3. 0

    Getting a nullpointer exception when switching displayables in J2ME

    Stack Overflow | 6 years ago | Pallinder
    java.lang.NullPointerException: 0 at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46 at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74 at com.sun.midp.chameleon.layers.SoftButtonLayer.soft1(), bci=37 at com.sun.midp.chameleon.layers.SoftButtonLayer.keyInput(), bci=36 at com.sun.midp.chameleon.CWindow.keyInput(), bci=38 at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handleKeyEvent(), bci=17 at com.sun.midp.lcdui.DisplayEventListener.process(), bci=277 at com.sun.midp.events.EventQueue.run(), bci=179
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    J2ME (Java) - Null Pointer Exception caught in Display Class

    Stack Overflow | 6 years ago | Tom
    java.lang.NullPointerException: 0 at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46 at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74 at com.sun.midp.chameleon.layers.SoftButtonLayer.soft1(), bci=37 at com.sun.midp.chameleon.layers.SoftButtonLayer.keyInput(), bci=36 at com.sun.midp.chameleon.CWindow.keyInput(), bci=38 at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handleKeyEvent(), bci=17 at com.sun.midp.lcdui.DisplayEventListener.process(), bci=277 at com.sun.midp.events.EventQueue.run(), bci=179
  6. 0

    Cloud Foundry v2 in Grails

    Stack Overflow | 3 years ago | angelo087
    java.lang.NullPointerException: Cannot invoke method getAt() on null object

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.mongodb.hadoop.output.MongoRecordWriter.write()
    2. com.mongodb.hadoop
      MongoRecordWriter.write
      1. com.mongodb.hadoop.output.MongoRecordWriter.write(MongoRecordWriter.java:115)
      1 frame
    3. Spark
      Executor$TaskRunner.run
      1. org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12$$anonfun$apply$4.apply$mcV$sp(PairRDDFunctions.scala:1036)
      2. org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12$$anonfun$apply$4.apply(PairRDDFunctions.scala:1034)
      3. org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12$$anonfun$apply$4.apply(PairRDDFunctions.scala:1034)
      4. org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1285)
      5. org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12.apply(PairRDDFunctions.scala:1042)
      6. org.apache.spark.rdd.PairRDDFunctions$$anonfun$saveAsNewAPIHadoopDataset$1$$anonfun$12.apply(PairRDDFunctions.scala:1014)
      7. org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:63)
      8. org.apache.spark.scheduler.Task.run(Task.scala:70)
      9. org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:213)
      9 frames
    4. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames