Exception in Spark

时间:2024-01-10 17:48:20
1: Exception in thread "main" org.apache.spark.SparkException: org.apache.spark.streaming.dstream.MappedDStream@5a69b104 has not been initialized

原因: StreamingContext.checkpoint(...)指定的checkpoint目录下有另一个application生成的checkpoint文件, 导致StreamContext.getOrCreate时加载checkpoint失败, StreamingContext初始化失败
解决方案: 删除该checkpoint目录或换一个目录进行checkpoint。 对于重新编译的Application, checkpoint目录下必须没有其他application生成的checkpoint文件