macos - Zeppelin java.lang.NoClassDefFoundError : Could not initialize class org. apache.spark.rdd.RDDOOperationScope$

标签 macos apache-spark apache-zeppelin

当我运行代码

val home = "/Users/adremja/Documents/Kaggle/outbrain"
val documents_categories = sc.textFile(home + "/documents_categories.csv")
documents_categories take(10) foreach println

在 spark-shell 中它完美地工作
scala> val home = "/Users/adremja/Documents/Kaggle/outbrain"
home: String = /Users/adremja/Documents/Kaggle/outbrain

scala> val documents_categories = sc.textFile(home + "/documents_categories.csv")
documents_categories: org.apache.spark.rdd.RDD[String] = /Users/adremja/Documents/Kaggle/outbrain/documents_categories.csv MapPartitionsRDD[21] at textFile at <console>:26

scala> documents_categories take(10) foreach println
document_id,category_id,confidence_level
1595802,1611,0.92
1595802,1610,0.07
1524246,1807,0.92
1524246,1608,0.07
1617787,1807,0.92
1617787,1608,0.07
1615583,1305,0.92
1615583,1806,0.07
1615460,1613,0.540646372

但是,当我尝试在 Zeppelin 中运行时出现错误
java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.rdd.RDDOperationScope$
  at org.apache.spark.SparkContext.withScope(SparkContext.scala:679)
  at org.apache.spark.SparkContext.textFile(SparkContext.scala:797)
  ... 46 elided

你知道问题出在哪里吗?

我有来自自制软件的 spark 2.0.1(我在 zeppelin-env.sh 中将它链接为 SPARK_HOME)和来自 Zeppelin 网站的 Zeppelin 0.6.2 二进制文件。

最佳答案

好的,看起来我找到了解决方案。我从 zeppelin 的 lib 文件夹中删除了:

  • jackson-annotations-2.5.0.jar
  • jackson-core-2.5.3.jar
  • jackson-databind-2.5.3.jar

  • 并将其替换为 spark 使用的 2.6.5 版。

    它现在有效,但我不知道我是否没有破坏其他任何东西。

    关于macos - Zeppelin java.lang.NoClassDefFoundError : Could not initialize class org. apache.spark.rdd.RDDOOperationScope$,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40329663/

    相关文章:

    scala - 在 Spark 中获取 Hive 表的 HDFS 位置

    apache-spark - 如何向通过 Spark 创建的 View 添加注释

    authentication - Zeppelin - LDAP 身份验证失败

    apache-spark - 如何增加在 Yarn UI 上显示的 "memory total"?

    macos - 哪个 NSTableView 接收 NSMenuItem?

    java - Spark-Java-foreachPartition

    objective-c - 拖动 View 中的项目

    apache-zeppelin - Apache zeppelin 进程死了

    Pythonlibs3 CMake 和 macOS

    macos - 如何挂接 OS X 字典