简体   繁体   English

NoClassDefFoundError:org/apache/spark/sql/hive/HiveContext

[英]NoClassDefFoundError:org/apache/spark/sql/hive/HiveContext

I am trying to use oozie to call spark jobs.我正在尝试使用 oozie 来调用 spark 作业。 And the spark job can be run successfully without oozie using spark-submit:并且可以使用 spark-submit 在没有 oozie 的情况下成功运行 spark 作业:

spark-submit --class xxx --master yarn-cluster --files xxx/hive-site.xml --jars xxx/datanucleus-api-jdo-3.2.6.jar,xxx/datanucleus-rdbms-3.2.9.jar,xxx/datanucleus-core-3.2.10.jar xxx.jar

But when I try to use oozie to call the job, it will always failed with the following error.但是当我尝试使用 oozie 调用作业时,它总是会失败并出现以下错误。 I have involved the 3 external jars and hive-site.xml in the workflow.xml我在workflow.xml中涉及了3个外部罐子和hive-site.xml

Launcher exception: org/apache/spark/sql/hive/HiveContext
java.lang.NoClassDefFoundError: org/apache/spark/sql/hive/HiveContext
    at xxx$.main(xxx.scala:20)
    at xxx.main(xxx.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:497)
    at org.apache.spark.deploy.SparkSubmit$.launch(SparkSubmit.scala:328)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:75)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
    at org.apache.oozie.action.hadoop.SparkMain.runSpark(SparkMain.java:104)
    at org.apache.oozie.action.hadoop.SparkMain.run(SparkMain.java:95)
    at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:47)
    at org.apache.oozie.action.hadoop.SparkMain.main(SparkMain.java:38)

The 20th line of my scala code is:我的 Scala 代码的第 20 行是:

val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)

Does anyone have any idea about this error?有没有人对这个错误有任何想法? I have been stuck for several days.我已经卡了好几天了。

Thank you!谢谢!

Just came back to answer my own question.刚回来回答我自己的问题。 This one ends up being solved by updating the shared lib of oozie.这个问题最终通过更新 oozie 的共享库来解决。 Basically, the jars in the shared lib are not complete for my job to run.基本上,共享库中的 jars 对于我的工作运行来说是不完整的。 So I first imported some additional jars such as spark-hive and spark-mllib.所以我首先导入了一些额外的 jar,比如 spark-hive 和 spark-mllib。 Also the jars provided in oozie shared lib were too old, which also needed to be updated to avoid some potential errors. oozie 共享库中提供的 jar 也太旧了,也需要更新以避免一些潜在的错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.NoClassDefFoundError-org / apache / spark / sql / hive / HiveContext - java.lang.NoClassDefFoundError - org/apache/spark/sql/hive/HiveContext java.lang.NoSuchMethodError:org.apache.spark.sql.hive.HiveContext.sql(Ljava / lang / String;)Lorg / apache / spark / sql / DataFrame - java.lang.NoSuchMethodError: org.apache.spark.sql.hive.HiveContext.sql(Ljava/lang/String;)Lorg/apache/spark/sql/DataFrame NoClassDefFoundError:spark-cassandra-connector中的org / apache / spark / sql / DataFrame - NoClassDefFoundError: org/apache/spark/sql/DataFrame in spark-cassandra-connector 在Spark上执行蜂巢查询-java.lang.NoClassDefFoundError org / apache / hive / spark / client / Job - Execute hive query on spark - java.lang.NoClassDefFoundError org/apache/hive/spark/client/Job Hive On Spark:java.lang.NoClassDefFoundError:org / apache / hive / spark / client / Job - Hive On Spark: java.lang.NoClassDefFoundError: org/apache/hive/spark/client/Job NoClassDefFoundError: org/apache/spark/SparkConf - NoClassDefFoundError: org/apache/spark/SparkConf java.lang.NoClassDefFoundError:org / apache / spark / sql / DataFrame - java.lang.NoClassDefFoundError: org/apache/spark/sql/DataFrame 关于java.lang.NoClassDefFoundError的错误:org / apache / spark / sql / SQLContext - Error on java.lang.NoClassDefFoundError: org/apache/spark/sql/SQLContext java.lang.NoClassDefFoundError: org/apache/spark/sql/SparkSession - java.lang.NoClassDefFoundError: org/apache/spark/sql/SparkSession Spark SQL(通过HiveContext进行Hive查询)始终创建31个分区 - Spark SQL(Hive query through HiveContext) always creating 31 partitions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM