com.fasterxml.jackson.databind.JsonMappingException:不兼容的Jackson版本:2.9.5

时间:2018-04-05 04:16:40

标签: scala jackson apache-kafka jackson-databind

我知道之前已经问过但是我遇到了以下错误,我需要升级杰克逊相关的jar因为漏洞扫描

 com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.9.5
            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:751)
            at org.apache.spark.rdd.RDDOperationScope$.<init>(RDDOperationScope.scala:82)
            at org.apache.spark.rdd.RDDOperationScope$.<clinit>(RDDOperationScope.scala)
            ... 12 more

我的build.gradle如下

configurations.all {
    resolutionStrategy.force 'com.fasterxml.jackson.core:jackson-databind:2.9.5'
    resolutionStrategy.force 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
}

 compileOnly "org.apache.spark:spark-streaming_2.11:2.1.0.cloudera1"
    compileOnly "org.apache.spark:spark-streaming-kafka-0-10_2.11:2.1.0"
compile "com.fasterxml.jackson.core:jackson-core:2.9.5@jar"
    compile "com.fasterxml.jackson.core:jackson-annotations:2.9.5@jar"
    compile "com.fasterxml.jackson.core:jackson-databind:2.9.5@jar"

知道使用jackson-databind 2.9.5需要使用哪种版本的spark流?

1 个答案:

答案 0 :(得分:1)

通过将jackson模块scala模块2.11更新为2.9.5版本来修复它