java.lang.ExceptionInInitializerError jackson版本冲突问题

java.lang.ExceptionInInitializerError jackson版本冲突问题

最近遇到jason版本冲突问题,导致程序运行异常。

Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.apache.spark.streaming.dstream.InputDStream.(InputDStream.scala:80)
	at org.apache.spark.streaming.kafka010.DirectKafkaInputDStream.(DirectKafkaInputDStream.scala:57)
	at org.apache.spark.streaming.kafka010.KafkaUtils$.createDirectStream(KafkaUtils.scala:147)
	at org.apache.spark.streaming.kafka010.KafkaUtils$.createDirectStream(KafkaUtils.scala:124)
	at org.apache.spark.streaming.kafka010.KafkaUtils$.createDirectStream(KafkaUtils.scala:168)
	at org.apache.spark.streaming.kafka010.KafkaUtils.createDirectStream(KafkaUtils.scala)
	at com.calabar.dec.main.LoadData2Tsdb2.createDirectStream(LoadData2Tsdb2.java:121)
	at com.calabar.dec.main.LoadData2Tsdb2.main(LoadData2Tsdb2.java:67)
Caused by: 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$.(RDDOperationScope.scala:82)
	at org.apache.spark.rdd.RDDOperationScope$.(RDDOperationScope.scala)
	... 8 more

由于之前没见过类似错误,没有提取到关键信息:

Caused by: com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.9.5

解决方案还是排除其他jar包的 com.fasterxml.jackson,重新添加一个低版本的包

排除


    
        com.fasterxml.jackson.core
        *
    

添加


    com.fasterxml.jackson.core
    jackson-databind
    2.6.6

其他问题:因为idea机制,暂时没法判断是哪些包的com.fasterxml导致冲突,还有关于com.fasterxml版本特性和导致冲突的原因,也需要再去了解下。 包括com.fasterxml.jackson.core的版本选择。

你可能感兴趣的:(程序基础)