com.fasterxml.jackson.databind.JsonMappingException: Jackson version is too old 2.5.3

dbl001 picture dbl001 · Aug 8, 2016 · Viewed 8.3k times · Source

My OS is OS X 10.11.6. I'm running Spark 2.0, Zeppelin 0.6, Scala 2.11

When I run this code in Zeppelin I get an exception from Jackson. When I run this code in spark-shell - no exception.

val filestream = ssc.textFileStream("/Users/davidlaxer/first-edition/ch06")

com.fasterxml.jackson.databind.JsonMappingException: Jackson version is too old 2.5.3
  at com.fasterxml.jackson.module.scala.JacksonModule$class.setupModule(JacksonModule.scala:56)
  at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:19)
  at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:651)
  at org.apache.spark.rdd.RDDOperationScope$.<init>(RDDOperationScope.scala:82)
  at org.apache.spark.rdd.RDDOperationScope$.<clinit>(RDDOperationScope.scala)
  at org.apache.spark.streaming.StreamingContext.withNamedScope(StreamingContext.scala:273)
  at org.apache.spark.streaming.StreamingContext.textFileStream(StreamingContext.scala:413)
  ... 51 elided

The dependency-reduced-pom.xml in spark-core shows version 2.6.5

<dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.6.5</version>
      <scope>compile</scope>
    </dependency>

The version of Maven is:

David-Laxers-MacBook-Pro:2.5.3 davidlaxer$ mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /opt/local/share/java/maven3
Java version: 1.8.0_05, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"

The version of Java is:

David-Laxers-MacBook-Pro:2.5.3 davidlaxer$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

Zeppelin was built with the following parameters:

$ mvn clean package -Pspark-2.0 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr -Pscala-2.11 -DskipTests

Generating the dependency tree in Zeppelin and in Spark showed all the jackson-databind references as 2.6.5.

$ mvn dependency:tree -Dverbose 
shows [INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.6.5:compile

I tried deleting ~/.m2/repository/com/fasterxml and rebuilding Spark and Zeppelin.

Here's my $PATH:

David-Laxers-MacBook-Pro:~ davidlaxer$ !e
echo $PATH
/Users/davidlaxer/.sdkman/candidates/springboot/current/bin:/Users/davidlaxer/.jenv/shims:/Users/davidlaxer/.jenv/bin:/Developer/NVIDIA/CUDA-6.5/bin:/usr/local/lib/erlang/erts-5.9.1/bin:/users/davidlaxer/anaconda/bin:/users/davidlaxer/anaconda/bin/bin:/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/usr/local/lib/erlang/erts-5.9.1/bin:/users/davidlaxer/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/CrossPack-AVR/bin:/usr/local/git/bin:/usr/texbin::/opt/local/bin/scala/bin::/usr/local/hadoop/bin:/usr/local/hadoop/sbin:/Users/davidlaxer/pig-0.13.0-src/bin:/Users/davidlaxer/pig-0.13.0-src/sbin:/Users/davidlaxer/Downloads/apache-maven-3.2.1/bin:/Users/davidlaxer/anaconda/bin/bin::/usr/local/hadoop/bin:/usr/local/hadoop/sbin:/Users/davidlaxer/.rvm/bin:/Library/Frameworks/JRuby.framework/Versions/Current/bin:/usr/local/gradle-source-build/bin:/Users/davidlaxer/bin:/Users/davidlaxer/storm/bin:/usr/bin:/usr/sbin:/Users/davidlaxer/spark/bin:/Library/PostgreSQL/9.4/bin:/usr/local/mysql/bin

Any ideas why I'm picking up version 2.5.3?

Answer

Feng Qian picture Feng Qian · Aug 8, 2016

Replacing the jackson jars (2.5.x version) in './zeppelin-zengine/target/lib/' and './zeppelin-server/target/lib/' with the following version will solve the problem.

jackson-databind-2.6.5.jar jackson-core-2.6.5.jar jackson-annotations-2.6.5.jar