我使用sbt組件來創建一個可以在火花上運行的胖罐子。依賴於grpc-netty
。火花上的Guava版本比grpc-netty
所要求的要舊,我遇到了這個錯誤:java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument。我能夠通過在spark上將userClassPathFirst設置爲true來解決此問題,但會導致其他錯誤。sbt組件着色來創建在火花上運行的胖罐子
糾正我,如果我錯了,但從我的理解,我不應該將userClassPathFirst設置爲true,如果我做正確的陰影。以下是我如何做陰影:
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("com.google.guava.**" -> "[email protected]")
.inLibrary("com.google.guava" % "guava" % "20.0")
.inLibrary("io.grpc" % "grpc-netty" % "1.1.2")
)
libraryDependencies ++= Seq(
"org.scalaj" %% "scalaj-http" % "2.3.0",
"org.json4s" %% "json4s-native" % "3.2.11",
"org.json4s" %% "json4s-jackson" % "3.2.11",
"org.apache.spark" %% "spark-core" % "2.2.0" % "provided",
"org.apache.spark" % "spark-sql_2.11" % "2.2.0" % "provided",
"org.clapper" %% "argot" % "1.0.3",
"com.typesafe" % "config" % "1.3.1",
"com.databricks" %% "spark-csv" % "1.5.0",
"org.apache.spark" % "spark-mllib_2.11" % "2.2.0" % "provided",
"io.grpc" % "grpc-netty" % "1.1.2",
"com.google.guava" % "guava" % "20.0"
)
我在做什麼錯在這裏,我該如何解決它?
謝謝尼古拉。你的解決方案就像一個魅力! –
@Kumar Bharath Prabhu很高興它幫助! –