apache spark - com.fasterxml.jackson.databind.JsonMappingExc



我的操作系统是OS X 10.11.6我正在运行Spark 2.0, Zeppelin 0.6, Scala 2.11

当我在Zeppelin中运行这段代码时,我从Jackson那里得到一个异常。当我在spark-shell中运行这段代码时,没有例外。

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

spark-core中的dependency-reduced-pom.xml显示2.6.5版本

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

Maven的版本是:

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"

Java版本:

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)

齐柏林飞艇的建造参数如下:

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

在Zeppelin和Spark中生成依赖树显示所有的jackson-databind引用都是2.6.5。

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

我尝试删除~/。m2/repository/com/fasterxml和重建Spark和Zeppelin。

这是我的$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

知道为什么我选择2.5.3版本吗?

更换杰克逊缸(2.5。X版本)in '。/zeppelin-zengine/target/lib/' and '。/zeppelin-server/target/lib/'使用以下版本将解决问题。

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

你可以使用$SPARK_HOME/jars/jackson- database -2.6.5.jar jackson-core-2.6.5.jar jackson-annotations-2.6.5.jar来替换$ZEPPELIN_HOME/lib的旧版本jar

相关内容

  • 没有找到相关文章

最新更新