Spark2.1.0 incompatible Jackson versions 2.7.6











up vote
27
down vote

favorite
8












I am trying to run a simple spark example in intellij, but I get the error like that:



Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.spark.SparkContext.withScope(SparkContext.scala:701)
at org.apache.spark.SparkContext.textFile(SparkContext.scala:819)
at spark.test$.main(test.scala:19)
at spark.test.main(test.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.7.6
at com.fasterxml.jackson.module.scala.JacksonModule$class.setupModule(JacksonModule.scala:64)
at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:19)
at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:730)
at org.apache.spark.rdd.RDDOperationScope$.<init>(RDDOperationScope.scala:82)
at org.apache.spark.rdd.RDDOperationScope$.<clinit>(RDDOperationScope.scala)


I have try to update my Jackson dependency, but it seems not work, I do this:



libraryDependencies += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"


but it still appear the same error messages, can some one help me to fix the error?



Here is spark example code:



object test {
def main(args: Array[String]): Unit = {
if (args.length < 1) {
System.err.println("Usage: <file>")
System.exit(1)
}

val conf = new SparkConf()
val sc = new SparkContext("local","wordcount",conf)
val line = sc.textFile(args(0))

line.flatMap(_.split(" ")).map((_, 1)).reduceByKey(_+_).collect().foreach(println)

sc.stop()
}
}


And here is my built.sbt:



name := "testSpark2"

version := "1.0"

scalaVersion := "2.11.8"


libraryDependencies += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"

libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-repl_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-streaming-flume_2.10" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-network-shuffle_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-streaming-kafka-0-10_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-hive_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-streaming-flume-assembly_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-mesos_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-catalyst_2.11" % "2.1.0"
libraryDependencies += "org.apache.spark" % "spark-launcher_2.11" % "2.1.0"









share|improve this question




























    up vote
    27
    down vote

    favorite
    8












    I am trying to run a simple spark example in intellij, but I get the error like that:



    Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.apache.spark.SparkContext.withScope(SparkContext.scala:701)
    at org.apache.spark.SparkContext.textFile(SparkContext.scala:819)
    at spark.test$.main(test.scala:19)
    at spark.test.main(test.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
    Caused by: com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.7.6
    at com.fasterxml.jackson.module.scala.JacksonModule$class.setupModule(JacksonModule.scala:64)
    at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:19)
    at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:730)
    at org.apache.spark.rdd.RDDOperationScope$.<init>(RDDOperationScope.scala:82)
    at org.apache.spark.rdd.RDDOperationScope$.<clinit>(RDDOperationScope.scala)


    I have try to update my Jackson dependency, but it seems not work, I do this:



    libraryDependencies += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
    libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"


    but it still appear the same error messages, can some one help me to fix the error?



    Here is spark example code:



    object test {
    def main(args: Array[String]): Unit = {
    if (args.length < 1) {
    System.err.println("Usage: <file>")
    System.exit(1)
    }

    val conf = new SparkConf()
    val sc = new SparkContext("local","wordcount",conf)
    val line = sc.textFile(args(0))

    line.flatMap(_.split(" ")).map((_, 1)).reduceByKey(_+_).collect().foreach(println)

    sc.stop()
    }
    }


    And here is my built.sbt:



    name := "testSpark2"

    version := "1.0"

    scalaVersion := "2.11.8"


    libraryDependencies += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
    libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"

    libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-repl_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-streaming-flume_2.10" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-network-shuffle_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-streaming-kafka-0-10_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-hive_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-streaming-flume-assembly_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-mesos_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-catalyst_2.11" % "2.1.0"
    libraryDependencies += "org.apache.spark" % "spark-launcher_2.11" % "2.1.0"









    share|improve this question


























      up vote
      27
      down vote

      favorite
      8









      up vote
      27
      down vote

      favorite
      8






      8





      I am trying to run a simple spark example in intellij, but I get the error like that:



      Exception in thread "main" java.lang.ExceptionInInitializerError
      at org.apache.spark.SparkContext.withScope(SparkContext.scala:701)
      at org.apache.spark.SparkContext.textFile(SparkContext.scala:819)
      at spark.test$.main(test.scala:19)
      at spark.test.main(test.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
      Caused by: com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.7.6
      at com.fasterxml.jackson.module.scala.JacksonModule$class.setupModule(JacksonModule.scala:64)
      at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:19)
      at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:730)
      at org.apache.spark.rdd.RDDOperationScope$.<init>(RDDOperationScope.scala:82)
      at org.apache.spark.rdd.RDDOperationScope$.<clinit>(RDDOperationScope.scala)


      I have try to update my Jackson dependency, but it seems not work, I do this:



      libraryDependencies += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
      libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"


      but it still appear the same error messages, can some one help me to fix the error?



      Here is spark example code:



      object test {
      def main(args: Array[String]): Unit = {
      if (args.length < 1) {
      System.err.println("Usage: <file>")
      System.exit(1)
      }

      val conf = new SparkConf()
      val sc = new SparkContext("local","wordcount",conf)
      val line = sc.textFile(args(0))

      line.flatMap(_.split(" ")).map((_, 1)).reduceByKey(_+_).collect().foreach(println)

      sc.stop()
      }
      }


      And here is my built.sbt:



      name := "testSpark2"

      version := "1.0"

      scalaVersion := "2.11.8"


      libraryDependencies += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
      libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"

      libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-repl_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-streaming-flume_2.10" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-network-shuffle_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-streaming-kafka-0-10_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-hive_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-streaming-flume-assembly_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-mesos_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-catalyst_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-launcher_2.11" % "2.1.0"









      share|improve this question















      I am trying to run a simple spark example in intellij, but I get the error like that:



      Exception in thread "main" java.lang.ExceptionInInitializerError
      at org.apache.spark.SparkContext.withScope(SparkContext.scala:701)
      at org.apache.spark.SparkContext.textFile(SparkContext.scala:819)
      at spark.test$.main(test.scala:19)
      at spark.test.main(test.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
      Caused by: com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.7.6
      at com.fasterxml.jackson.module.scala.JacksonModule$class.setupModule(JacksonModule.scala:64)
      at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:19)
      at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:730)
      at org.apache.spark.rdd.RDDOperationScope$.<init>(RDDOperationScope.scala:82)
      at org.apache.spark.rdd.RDDOperationScope$.<clinit>(RDDOperationScope.scala)


      I have try to update my Jackson dependency, but it seems not work, I do this:



      libraryDependencies += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
      libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"


      but it still appear the same error messages, can some one help me to fix the error?



      Here is spark example code:



      object test {
      def main(args: Array[String]): Unit = {
      if (args.length < 1) {
      System.err.println("Usage: <file>")
      System.exit(1)
      }

      val conf = new SparkConf()
      val sc = new SparkContext("local","wordcount",conf)
      val line = sc.textFile(args(0))

      line.flatMap(_.split(" ")).map((_, 1)).reduceByKey(_+_).collect().foreach(println)

      sc.stop()
      }
      }


      And here is my built.sbt:



      name := "testSpark2"

      version := "1.0"

      scalaVersion := "2.11.8"


      libraryDependencies += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
      libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"

      libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-repl_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-streaming-flume_2.10" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-network-shuffle_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-streaming-kafka-0-10_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-hive_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-streaming-flume-assembly_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-mesos_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-catalyst_2.11" % "2.1.0"
      libraryDependencies += "org.apache.spark" % "spark-launcher_2.11" % "2.1.0"






      scala apache-spark jackson sbt incompatibletypeerror






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 8 '17 at 6:34

























      asked May 8 '17 at 6:27









      Yang

      2451314




      2451314
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          39
          down vote



          accepted










          Spark 2.1.0 contains com.fasterxml.jackson.core as transitive dependency. So, we do not need to include then in libraryDependencies.



          But if you want to add a different com.fasterxml.jackson.core dependencies' version then you have to override them. Like this:



          name := "testSpark2"

          version := "1.0"

          scalaVersion := "2.11.8"


          dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
          dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"
          dependencyOverrides += "com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.8.7"

          libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-repl_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-streaming-flume_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-network-shuffle_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-streaming-kafka-0-10_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-hive_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-streaming-flume-assembly_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-mesos_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-catalyst_2.11" % "2.1.0"
          libraryDependencies += "org.apache.spark" % "spark-launcher_2.11" % "2.1.0"


          So, change your build.sbt like the one above and it will work as expected.



          I hope it helps!






          share|improve this answer




























            up vote
            4
            down vote













            FYI. For my case, I'm using spark and kafka-streams in the app, while kafka-streams uses com.fasterxml.jackson.core 2.8.5. Adding exclude as below fixed the issue



            (gradle)



            compile (group: "org.apache.kafka", name: "kafka-streams", version: "0.11.0.0"){
            exclude group:"com.fasterxml.jackson.core"
            }





            share|improve this answer





















            • Were you having the exact same problem? Incompatible Jackson version?
              – Filipe Miranda
              Sep 25 at 19:07




















            up vote
            1
            down vote













            Solution with Gradle, by using the resolutionStrategy (https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html):



            configurations {

            all {

            resolutionStrategy {
            force 'com.fasterxml.jackson.core:jackson-core:2.4.4', 'com.fasterxml.jackson.core:jackson-databind:2.4.4', 'com.fasterxml.jackson.core:jackson-annotations:2.4.4'
            }
            }
            }





            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43841091%2fspark2-1-0-incompatible-jackson-versions-2-7-6%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              39
              down vote



              accepted










              Spark 2.1.0 contains com.fasterxml.jackson.core as transitive dependency. So, we do not need to include then in libraryDependencies.



              But if you want to add a different com.fasterxml.jackson.core dependencies' version then you have to override them. Like this:



              name := "testSpark2"

              version := "1.0"

              scalaVersion := "2.11.8"


              dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
              dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"
              dependencyOverrides += "com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.8.7"

              libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-repl_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-streaming-flume_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-network-shuffle_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-streaming-kafka-0-10_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-hive_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-streaming-flume-assembly_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-mesos_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-catalyst_2.11" % "2.1.0"
              libraryDependencies += "org.apache.spark" % "spark-launcher_2.11" % "2.1.0"


              So, change your build.sbt like the one above and it will work as expected.



              I hope it helps!






              share|improve this answer

























                up vote
                39
                down vote



                accepted










                Spark 2.1.0 contains com.fasterxml.jackson.core as transitive dependency. So, we do not need to include then in libraryDependencies.



                But if you want to add a different com.fasterxml.jackson.core dependencies' version then you have to override them. Like this:



                name := "testSpark2"

                version := "1.0"

                scalaVersion := "2.11.8"


                dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
                dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"
                dependencyOverrides += "com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.8.7"

                libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-repl_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-streaming-flume_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-network-shuffle_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-streaming-kafka-0-10_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-hive_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-streaming-flume-assembly_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-mesos_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-catalyst_2.11" % "2.1.0"
                libraryDependencies += "org.apache.spark" % "spark-launcher_2.11" % "2.1.0"


                So, change your build.sbt like the one above and it will work as expected.



                I hope it helps!






                share|improve this answer























                  up vote
                  39
                  down vote



                  accepted







                  up vote
                  39
                  down vote



                  accepted






                  Spark 2.1.0 contains com.fasterxml.jackson.core as transitive dependency. So, we do not need to include then in libraryDependencies.



                  But if you want to add a different com.fasterxml.jackson.core dependencies' version then you have to override them. Like this:



                  name := "testSpark2"

                  version := "1.0"

                  scalaVersion := "2.11.8"


                  dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
                  dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"
                  dependencyOverrides += "com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.8.7"

                  libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-repl_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-streaming-flume_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-network-shuffle_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-streaming-kafka-0-10_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-hive_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-streaming-flume-assembly_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-mesos_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-catalyst_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-launcher_2.11" % "2.1.0"


                  So, change your build.sbt like the one above and it will work as expected.



                  I hope it helps!






                  share|improve this answer












                  Spark 2.1.0 contains com.fasterxml.jackson.core as transitive dependency. So, we do not need to include then in libraryDependencies.



                  But if you want to add a different com.fasterxml.jackson.core dependencies' version then you have to override them. Like this:



                  name := "testSpark2"

                  version := "1.0"

                  scalaVersion := "2.11.8"


                  dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
                  dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"
                  dependencyOverrides += "com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.8.7"

                  libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-repl_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-streaming-flume_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-network-shuffle_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-streaming-kafka-0-10_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-hive_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-streaming-flume-assembly_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-mesos_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-catalyst_2.11" % "2.1.0"
                  libraryDependencies += "org.apache.spark" % "spark-launcher_2.11" % "2.1.0"


                  So, change your build.sbt like the one above and it will work as expected.



                  I hope it helps!







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 8 '17 at 10:15









                  himanshuIIITian

                  2,92922043




                  2,92922043
























                      up vote
                      4
                      down vote













                      FYI. For my case, I'm using spark and kafka-streams in the app, while kafka-streams uses com.fasterxml.jackson.core 2.8.5. Adding exclude as below fixed the issue



                      (gradle)



                      compile (group: "org.apache.kafka", name: "kafka-streams", version: "0.11.0.0"){
                      exclude group:"com.fasterxml.jackson.core"
                      }





                      share|improve this answer





















                      • Were you having the exact same problem? Incompatible Jackson version?
                        – Filipe Miranda
                        Sep 25 at 19:07

















                      up vote
                      4
                      down vote













                      FYI. For my case, I'm using spark and kafka-streams in the app, while kafka-streams uses com.fasterxml.jackson.core 2.8.5. Adding exclude as below fixed the issue



                      (gradle)



                      compile (group: "org.apache.kafka", name: "kafka-streams", version: "0.11.0.0"){
                      exclude group:"com.fasterxml.jackson.core"
                      }





                      share|improve this answer





















                      • Were you having the exact same problem? Incompatible Jackson version?
                        – Filipe Miranda
                        Sep 25 at 19:07















                      up vote
                      4
                      down vote










                      up vote
                      4
                      down vote









                      FYI. For my case, I'm using spark and kafka-streams in the app, while kafka-streams uses com.fasterxml.jackson.core 2.8.5. Adding exclude as below fixed the issue



                      (gradle)



                      compile (group: "org.apache.kafka", name: "kafka-streams", version: "0.11.0.0"){
                      exclude group:"com.fasterxml.jackson.core"
                      }





                      share|improve this answer












                      FYI. For my case, I'm using spark and kafka-streams in the app, while kafka-streams uses com.fasterxml.jackson.core 2.8.5. Adding exclude as below fixed the issue



                      (gradle)



                      compile (group: "org.apache.kafka", name: "kafka-streams", version: "0.11.0.0"){
                      exclude group:"com.fasterxml.jackson.core"
                      }






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Oct 23 '17 at 6:50









                      Leon

                      1,021620




                      1,021620












                      • Were you having the exact same problem? Incompatible Jackson version?
                        – Filipe Miranda
                        Sep 25 at 19:07




















                      • Were you having the exact same problem? Incompatible Jackson version?
                        – Filipe Miranda
                        Sep 25 at 19:07


















                      Were you having the exact same problem? Incompatible Jackson version?
                      – Filipe Miranda
                      Sep 25 at 19:07






                      Were you having the exact same problem? Incompatible Jackson version?
                      – Filipe Miranda
                      Sep 25 at 19:07












                      up vote
                      1
                      down vote













                      Solution with Gradle, by using the resolutionStrategy (https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html):



                      configurations {

                      all {

                      resolutionStrategy {
                      force 'com.fasterxml.jackson.core:jackson-core:2.4.4', 'com.fasterxml.jackson.core:jackson-databind:2.4.4', 'com.fasterxml.jackson.core:jackson-annotations:2.4.4'
                      }
                      }
                      }





                      share|improve this answer

























                        up vote
                        1
                        down vote













                        Solution with Gradle, by using the resolutionStrategy (https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html):



                        configurations {

                        all {

                        resolutionStrategy {
                        force 'com.fasterxml.jackson.core:jackson-core:2.4.4', 'com.fasterxml.jackson.core:jackson-databind:2.4.4', 'com.fasterxml.jackson.core:jackson-annotations:2.4.4'
                        }
                        }
                        }





                        share|improve this answer























                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          Solution with Gradle, by using the resolutionStrategy (https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html):



                          configurations {

                          all {

                          resolutionStrategy {
                          force 'com.fasterxml.jackson.core:jackson-core:2.4.4', 'com.fasterxml.jackson.core:jackson-databind:2.4.4', 'com.fasterxml.jackson.core:jackson-annotations:2.4.4'
                          }
                          }
                          }





                          share|improve this answer












                          Solution with Gradle, by using the resolutionStrategy (https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html):



                          configurations {

                          all {

                          resolutionStrategy {
                          force 'com.fasterxml.jackson.core:jackson-core:2.4.4', 'com.fasterxml.jackson.core:jackson-databind:2.4.4', 'com.fasterxml.jackson.core:jackson-annotations:2.4.4'
                          }
                          }
                          }






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 19 at 17:11









                          Thomas Decaux

                          12.5k25659




                          12.5k25659






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43841091%2fspark2-1-0-incompatible-jackson-versions-2-7-6%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Costa Masnaga

                              Fotorealismo

                              Sidney Franklin