Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2577A200C6E for ; Mon, 24 Apr 2017 04:04:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 23FE6160BB1; Mon, 24 Apr 2017 02:04:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 44DFA160BA6 for ; Mon, 24 Apr 2017 04:04:08 +0200 (CEST) Received: (qmail 71160 invoked by uid 500); 24 Apr 2017 02:04:07 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 71151 invoked by uid 99); 24 Apr 2017 02:04:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Apr 2017 02:04:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E53A1CCF62 for ; Mon, 24 Apr 2017 02:04:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id OuSzl8SCxR_M for ; Mon, 24 Apr 2017 02:04:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 156655FBE5 for ; Mon, 24 Apr 2017 02:04:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4C3D1E002B for ; Mon, 24 Apr 2017 02:04:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0936721B53 for ; Mon, 24 Apr 2017 02:04:04 +0000 (UTC) Date: Mon, 24 Apr 2017 02:04:04 +0000 (UTC) From: "fangfengbin (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SPARK-20436) NullPointerException when restart from checkpoint file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 24 Apr 2017 02:04:09 -0000 [ https://issues.apache.org/jira/browse/SPARK-20436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15980631#comment-15980631 ] fangfengbin commented on SPARK-20436: ------------------------------------- [~tdas], can you help have a look at this problem? thanks > NullPointerException when restart from checkpoint file > ------------------------------------------------------ > > Key: SPARK-20436 > URL: https://issues.apache.org/jira/browse/SPARK-20436 > Project: Spark > Issue Type: Bug > Components: DStreams > Affects Versions: 1.5.0 > Reporter: fangfengbin > > I have written a Spark Streaming application which have two DStreams. > Code is : > object KafkaTwoInkfk { > def main(args: Array[String]) { > val Array(checkPointDir, brokers, topic1, topic2, batchSize) = args > val ssc = StreamingContext.getOrCreate(checkPointDir, () => createContext(args)) > ssc.start() > ssc.awaitTermination() > } > def createContext(args : Array[String]) : StreamingContext = { > val Array(checkPointDir, brokers, topic1, topic2, batchSize) = args > val sparkConf = new SparkConf().setAppName("KafkaWordCount") > val ssc = new StreamingContext(sparkConf, Seconds(batchSize.toLong)) > ssc.checkpoint(checkPointDir) > val topicArr1 = topic1.split(",") > val topicSet1 = topicArr1.toSet > val topicArr2 = topic2.split(",") > val topicSet2 = topicArr2.toSet > val kafkaParams = Map[String, String]( > "metadata.broker.list" -> brokers > ) > val lines1 = KafkaUtils.createDirectStream[String, String, StringDecoder, StringDecoder](ssc, kafkaParams, topicSet1) > val words1 = lines1.map(_._2).flatMap(_.split(" ")) > val wordCounts1 = words1.map(x => { > (x, 1L)}).reduceByKey(_ + _) > wordCounts1.print() > val lines2 = KafkaUtils.createDirectStream[String, String, StringDecoder, StringDecoder](ssc, kafkaParams, topicSet2) > val words2 = lines1.map(_._2).flatMap(_.split(" ")) > val wordCounts2 = words2.map(x => { > (x, 1L)}).reduceByKey(_ + _) > wordCounts2.print() > return ssc > } > } > when restart from checkpoint file, it throw NullPointerException: > java.lang.NullPointerException > at org.apache.spark.streaming.dstream.DStreamCheckpointData$$anonfun$writeObject$1.apply$mcV$sp(DStreamCheckpointData.scala:126) > at org.apache.spark.streaming.dstream.DStreamCheckpointData$$anonfun$writeObject$1.apply(DStreamCheckpointData.scala:124) > at org.apache.spark.streaming.dstream.DStreamCheckpointData$$anonfun$writeObject$1.apply(DStreamCheckpointData.scala:124) > at org.apache.spark.util.Utils$.tryOrIOException(Utils.scala:1291) > at org.apache.spark.streaming.dstream.DStreamCheckpointData.writeObject(DStreamCheckpointData.scala:124) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028) > at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) > at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) > at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) > at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441) > at org.apache.spark.streaming.dstream.DStream$$anonfun$writeObject$1.apply$mcV$sp(DStream.scala:528) > at org.apache.spark.streaming.dstream.DStream$$anonfun$writeObject$1.apply(DStream.scala:523) > at org.apache.spark.streaming.dstream.DStream$$anonfun$writeObject$1.apply(DStream.scala:523) > at org.apache.spark.util.Utils$.tryOrIOException(Utils.scala:1291) > at org.apache.spark.streaming.dstream.DStream.writeObject(DStream.scala:523) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028) > at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) > at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) > at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1378) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) > at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) > at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) > at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) > at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) > at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441) > at org.apache.spark.streaming.DStreamGraph$$anonfun$writeObject$1.apply$mcV$sp(DStreamGraph.scala:190) > at org.apache.spark.streaming.DStreamGraph$$anonfun$writeObject$1.apply(DStreamGraph.scala:185) > at org.apache.spark.streaming.DStreamGraph$$anonfun$writeObject$1.apply(DStreamGraph.scala:185) > at org.apache.spark.util.Utils$.tryOrIOException(Utils.scala:1291) > at org.apache.spark.streaming.DStreamGraph.writeObject(DStreamGraph.scala:185) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028) > at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) > at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) > at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) > at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) > at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) > at org.apache.spark.streaming.Checkpoint$$anonfun$serialize$1.apply$mcV$sp(Checkpoint.scala:145) > at org.apache.spark.streaming.Checkpoint$$anonfun$serialize$1.apply(Checkpoint.scala:145) > at org.apache.spark.streaming.Checkpoint$$anonfun$serialize$1.apply(Checkpoint.scala:145) > at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1325) > at org.apache.spark.streaming.Checkpoint$.serialize(Checkpoint.scala:146) > at org.apache.spark.streaming.StreamingContext.validate(StreamingContext.scala:524) > at org.apache.spark.streaming.StreamingContext.liftedTree1$1(StreamingContext.scala:572) > at org.apache.spark.streaming.StreamingContext.start(StreamingContext.scala:571) > at com.spark.test.KafkaTwoInkfk$.main(KafkaTwoInkfk.scala:21) > at com.spark.test.KafkaTwoInkfk.main(KafkaTwoInkfk.scala) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:760) > at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:190) > at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:215) > at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:129) > at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala) -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org