为什么提交作业失败,"的NoSuchMethodError:scala.runtime.VolatileObjectRef.zero()Lscala /运行/ VolatileObjectRef;"? [英] Why does submitting a job fail with "NoSuchMethodError: scala.runtime.VolatileObjectRef.zero()Lscala/runtime/VolatileObjectRef;"?
问题描述
我想提出一个火花的工作
I'm trying to submit a spark job
它开始是这样的:
import javax.xml.parsers.{SAXParser, SAXParserFactory}
import org.apache.spark
import org.apache.spark.graphx.{Graph, Edge, VertexId}
import org.apache.spark.rdd.{PairRDDFunctions, RDD}
import org.apache.spark.storage.StorageLevel
import org.apache.spark.{SparkContext, SparkConf}
import scala.util.Try
import org.apache.log4j.{Level, Logger}
object MyApp {
def main(args: Array[String]) {
val sparkConf = new SparkConf().setAppName("MyApp")
val sc = new SparkContext(sparkConf)
当我启动它,我得到以下错误:
And when I launch it I get the following error:
App > Exception in thread "main" java.lang.NoSuchMethodError: scala.runtime.VolatileObjectRef.zero()Lscala/runtime/VolatileObjectRef;
App > at MyApp$.main(MyApp.scala)
App > at MyApp.main(MyApp.scala)
App > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
App > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
App > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
App > at java.lang.reflect.Method.invoke(Method.java:606)
App > at org.apache.spark.deploy.SparkSubmit$.launch(SparkSubmit.scala:328)
App > at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:75)
App > at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
我是什么做错了吗?
What am I doing wrong?
编辑:包括完整的堆栈跟踪。
使用Scala 2.10和Spark 1.2.0。
什么是奇怪的是,在我的罐子,我有两个班。当我提出火花之一,它的工作原理(这是一个4行假人的工作),但是当我运行较长的(约40行),如果失败,出现错误上述
Included full stack trace. Using Scala 2.10 and Spark 1.2.0. What's weird is that in my jar, I have two classes. When I spark submit one, it works (it's a 4 lines dummy job), but when I run the longer one (about 40 lines), if fails with the error above
推荐答案
零()
在 scala.runtime.VolatileObjectRef
已在斯卡拉2.11被引入
你可能有一个库编译反对斯卡拉2.11和Scala的2.10运行时中运行。
zero()
on scala.runtime.VolatileObjectRef
has been introduced in Scala 2.11
You probably have a library compiled against Scala 2.11 and running on a Scala 2.10 runtime.
请参阅
- 2.10:的https://github.com/scala/scala/blob/2.10.x/src/library/scala/runtime/VolatileObjectRef.java
- V2.11:的https://github.com/scala/scala/blob/2.11.x/src/library/scala/runtime/VolatileObjectRef.java
这篇关于为什么提交作业失败,"的NoSuchMethodError:scala.runtime.VolatileObjectRef.zero()Lscala /运行/ VolatileObjectRef;"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!