org.apache.spark.SparkException

Task not serializable

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web70

Stack trace

  • org.apache.spark.SparkException: Task not serializable at org.apache.spark.util.ClosureCleaner$.ensureSerializable(ClosureCleaner.scala:298) at org.apache.spark.util.ClosureCleaner$.org$apache$spark$util$ClosureCleaner$$clean(ClosureCleaner.scala:288) at org.apache.spark.util.ClosureCleaner$.clean(ClosureCleaner.scala:108) at org.apache.spark.SparkContext.clean(SparkContext.scala:2039) at org.apache.spark.rdd.RDD$$anonfun$map$1.apply(RDD.scala:366) at org.apache.spark.rdd.RDD$$anonfun$map$1.apply(RDD.scala:365) at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151) at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112) at org.apache.spark.rdd.RDD.withScope(RDD.scala:358) at org.apache.spark.rdd.RDD.map(RDD.scala:365) at org.apache.spark.api.java.JavaRDDLike$class.map(JavaRDDLike.scala:92) at org.apache.spark.api.java.AbstractJavaRDDLike.map(JavaRDDLike.scala:45) at topicmodeling.TopicModelingTest.testTFIDF(TopicModelingTest.java:188) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

johnxflyjohnxfly
3 times, last one
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,