[英]Spark : java.lang.NoClassDefFoundError: scala/collection/mutable/ArraySeq$ofRef
I am trying to run a simple word count program with spark-submit
and getting an exception.我正在尝试使用spark-submit
运行一个简单的字数统计程序并遇到异常。
Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: scala/collection/mutable/ArraySeq$ofRef at SparkWordCount$.main(SparkWordCount.scala:18) Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: scala/collection/mutable/ArraySeq$ofRef at SparkWordCount$.main(SparkWordCount.scala:18)
The code, starting with line 18 is从第 18 行开始的代码是
val count = input.flatMap(line ⇒ line.split(" "))
.map(word ⇒ (word, 1))
.reduceByKey(_ + _)
My environment:我的环境:
As stated in the comments, the solution is to use for development the same version of Scala that you will use on the cluster.如评论中所述,解决方案是使用您将在集群上使用的相同版本的 Scala 进行开发。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.