gpt4 book ai didi

apache-spark - com.fasterxml.jackson.databind.JsonMappingException : Jackson version is too old 2. 5.3

转载 作者:行者123 更新时间:2023-12-04 04:47:08 25 4
gpt4 key购买 nike

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

当我在 Zeppelin 中运行此代码时,我从 Jackson 那里得到一个异常。
当我在 spark-shell 中运行此代码时 - 也不异常(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

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)

Zeppelin 使用以下参数构建:
$ 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 版吗?

最佳答案

将 './zeppelin-zengine/target/lib/' 和 './zeppelin-server/target/lib/' 中的 jackson jars(2.5.x 版本)替换为以下版本将解决问题。

jackson-databind-2.6.5.jar
jackson 核心2.6.5.jar
jackson-annotations-2.6.5.jar

关于apache-spark - com.fasterxml.jackson.databind.JsonMappingException : Jackson version is too old 2. 5.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38819763/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com