我有一个 Spark-scala 应用程序。我尝试显示一条简单的消息 - “Hello my App”。当我编译它时sbt compile
并运行它sbt run
没关系。我成功显示了我的消息,但他显示了错误;像这样:
Hello my application!
16/11/27 15:17:11 ERROR Utils: uncaught error in thread SparkListenerBus, stopping SparkContext
java.lang.InterruptedException
ERROR ContextCleaner: Error in cleaning thread
java.lang.InterruptedException
at org.apache.spark.ContextCleaner$$anon$1.run(ContextCleaner.scala:67)
16/11/27 15:17:11 INFO SparkUI: Stopped Spark web UI at http://10.0.2.15:4040
[success] Total time: 13 s, completed Nov 27, 2016 3:17:12 PM
16/11/27 15:17:12 INFO DiskBlockManager: Shutdown hook called
我不明白这好不好!
此外,当我尝试在运行后加载文件 jar 时,它会显示错误。
我的命令行如下所示:
spark-submit "appfilms" --master local[4] target/scala-2.11/system-of-recommandation_2.11-1.0.jar
错误是:
Error: Cannot load main class from JAR file:/root/projectFilms/appfilms
Run with --help for usage help or --verbose for debug output
16/11/27 15:24:11 INFO Utils: Shutdown hook called
请问您能回答我吗!
该错误是由于 SparkContext 未停止而导致的,这在高于 Spark 2.x 的版本中是必需的。
应停止此操作以防止出现此错误SparkContext.stop()
, or sc.stop()
。解决此错误的灵感来自于自己的经验和以下来源:火花上下文 https://spark.apache.org/docs/latest/api/java/org/apache/spark/SparkContext.html, Spark 侦听器总线错误 https://stackoverflow.com/questions/28362341/error-utils-uncaught-exception-in-thread-sparklistenerbus
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)