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

2

7

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?

Ensign answered 8/8, 2016 at 0:17 Comment(0)
C
6

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

Czarina answered 8/8, 2016 at 11:0 Comment(5)
Ok. I'll try it. Meanwhile I reverted to Spark 1.6 and Zeppelin 0.56. I'm getting: com.fasterxml.jackson.databind.JsonMappingException: Could not find creator property with name 'id' (in class org.apache.spark.rdd.RDDOperationScope) at [Source: {"id":"0","name":"text file stream"}; line: 1, column: 1] Is this the same problem?Ensign
What causes mvn to install the older jars?Ensign
After replacing the .jar files in both directories, rerun the mvn command? E.g. mvn clean package -Pspark-1.6 -Phadoop-2.6 -DskipTests -Dhadoop.version=2.6.4Ensign
running mvn without clean reinstalls the outdated jackson jars.Ensign
restarting the zeppelin-daemon.sh with the new jars get: java.lang.VerifyError: class com.fasterxml.jackson.module.scala.ser.ScalaIteratorSerializer overrides final method withResolved.(Lcom/fasterxml/jackson/databind/BeanProperty;Lcom/fasterxml/jackson/databind/jsontype/TypeSerializer;Lcom/fasterxml/jackson/databind/JsonSerializer;)Lcom/fasterxml/jackson/databind/ser/std/AsArraySerializerBase; at java.lang.ClassLoader.defineClass1(Native Method)Ensign
B
0

you can use $SPARK_HOME/jars/ jackson-databind-2.6.5.jar jackson-core-2.6.5.jar jackson-annotations-2.6.5.jar to replace old version jars ofr $ZEPPELIN_HOME/lib

Bruni answered 1/2, 2018 at 6:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.