scala - ERROR when using SPARK : java.lang.NoClassDefFoundError: dispatch/Http -
when using spark-submit error happen:
error executor: exception in task 0.0 in stage 137.0 (tid 35) java.lang.noclassdeffounderror: dispatch/http$
although have import lib (i'm using scala) :
import dispatch._, defaults._
part of code :
def publishtonsq(data: string) = { val topic = "post_similar_items_to_elasticsearch" val host = "192.168.100.160:4151" def myrequest = url(s"$host/pub?topic=$topic") def myrequestasjson = myrequest.setcontenttype("application/json", "utf-8") def mypostwithbody = myrequestasjson << data val response = http(mypostwithbody ok as.string) println(response) }
this part of build.sbt :
scalaversion := "2.10.5" librarydependencies += "org.apache.spark" %% "spark-core" % "1.6.1" librarydependencies += "org.apache.spark" %% "spark-mllib" % "1.6.1" librarydependencies += "org.json4s" %% "json4s-native" % "3.4.0" librarydependencies += "org.json4s" %% "json4s-jackson" % "3.4.0" librarydependencies += "org.scalaj" %% "scalaj-http" % "1.1.4" librarydependencies += "net.databinder.dispatch" %% "dispatch-core" % "0.11.2" resolvers += resolver.mavenlocal
any solution ?
the dependency not in jar, resolved if configure in java.lang.noclassdeffounderror: org/apache/spark/streaming/twitter/twitterutils
Comments
Post a Comment