在我的应用程序中,我正在从cassandra中检索数据并使用akka喷雾提供其余的api。当我在IDE中运行时它工作正常。但是当我在我的机器上本地运行Spark submit
时出现错误,如下所示
[ERROR] [04/05/2016 10:43:38.687] [default-akka.actor.default-dispatcher-5] [ActorSystem(默认值)]来自线程的未捕获致命错误[default-akka.actor.default -dispatcher-5]关闭ActorSystem [默认] java.lang.NoSuchMethodError:org.apache.spark.sql.cassandra.CassandraSQLContext $$ anon $ 1.DDLStrategy()Lorg / apache / spark / sql / execution / SparkStrategies $ DDLStrategy $; 在org.apache.spark.sql.cassandra.CassandraSQLContext $$ anon $ 1.(CassandraSQLContext.scala:89) 在org.apache.spark.sql.cassandra.CassandraSQLContext。(CassandraSQLContext.scala:85)
我的build.sbt如下所示。
scalaVersion := "2.10.5"
libraryDependencies += "org.apache.spark" %% "spark-core" % "1.4.0"
libraryDependencies += "org.apache.spark" %% "spark-streaming" % "1.4.0"
libraryDependencies += "org.apache.spark" % "spark-sql_2.10" % "1.4.0"
libraryDependencies += "com.datastax.spark" %% "spark-cassandra-connector" % "1.4.0" withSources() withJavadoc()
resolvers ++= Seq(
"Akka Repository" at "http://repo.akka.io/releases/")
resolvers ++= Seq("Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
"Spray Repository" at "http://repo.spray.io")
libraryDependencies +=
"com.typesafe.akka" %% "akka-actor" % "2.3.14"
libraryDependencies ++= {
val sprayVersion = "1.3.2"
Seq(
"io.spray" %% "spray-can" % sprayVersion,
"io.spray" %% "spray-routing" % sprayVersion,
"io.spray" %% "spray-json" % sprayVersion
)
}
请让我知道我做了什么错。谢谢。你的所有建议都是有价值的。
答案 0 :(得分:0)
您可能正在提交仅包含您的代码的JAR。您必须使用--jars参数将spark-cassandra-connector添加到类路径(用于spark-submit)(请参阅Spark submit's advanced dependency management)
或者,您可以尝试构建一个胖JAR(包含依赖项)并在您到目前为止提交它。您可以使用sbt-assembly
从SBT构建胖JAR