2017-02-03 94 views
0

這是我得到的錯誤:星火卡夫卡流給不兼容的傑克遜異常

java.lang.ExceptionInInitializerError 
    at org.apache.spark.streaming.dstream.InputDStream.<init>(InputDStream.scala:78) 
    at org.apache.spark.streaming.kafka010.DirectKafkaInputDStream.<init>(DirectKafkaInputDStream.scala:62) 
    at org.apache.spark.streaming.kafka010.KafkaUtils$.createDirectStream(KafkaUtils.scala:150) 
    at org.apache.spark.streaming.kafka010.KafkaUtils$.createDirectStream(KafkaUtils.scala:127) 
    at chirpanywhere.stream.classification.service.streaming.StreamingClassificationPipeline.createStreamAndTransform(StreamingClassificationPipeline.scala:69) 
    at chirpanywhere.stream.classification.service.streaming.StreamingClassificationPipeline.streamAndUpdateMLModelCache(StreamingClassificationPipeline.scala:58) 
    at chirpanywhere.stream.classification.service.streaming.StreamingClassificationPipeline.run(StreamingClassificationPipeline.scala:54) 
    at chirpanywhere.stream.classification.service.Boot$.main(Boot.scala:10) 
    at chirpanywhere.stream.classification.service.Boot.main(Boot.scala) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.7.8 
    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:730) 
    at org.apache.spark.rdd.RDDOperationScope$.<init>(RDDOperationScope.scala:82) 
    at org.apache.spark.rdd.RDDOperationScope$.<clinit>(RDDOperationScope.scala) 
    at org.apache.spark.streaming.dstream.InputDStream.<init>(InputDStream.scala:78) 
    at org.apache.spark.streaming.kafka010.DirectKafkaInputDStream.<init>(DirectKafkaInputDStream.scala:62) 
    at org.apache.spark.streaming.kafka010.KafkaUtils$.createDirectStream(KafkaUtils.scala:150) 
    at org.apache.spark.streaming.kafka010.KafkaUtils$.createDirectStream(KafkaUtils.scala:127) 
    at chirpanywhere.stream.classification.service.streaming.StreamingClassificationPipeline.createStreamAndTransform(StreamingClassificationPipeline.scala:69) 
    at chirpanywhere.stream.classification.service.streaming.StreamingClassificationPipeline.streamAndUpdateMLModelCache(StreamingClassificationPipeline.scala:58) 
    at chirpanywhere.stream.classification.service.streaming.StreamingClassificationPipeline.run(StreamingClassificationPipeline.scala:54) 
    at chirpanywhere.stream.classification.service.Boot$.main(Boot.scala:10) 
    at chirpanywhere.stream.classification.service.Boot.main(Boot.scala) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 

有人能告訴我出了什麼問題。

我build.sbt看起來是這樣的:

val akkaHttpV = "10.0.0" 
    val sparkV = "2.1.0" 

"log4j" % "log4j" % "1.2.17", 
    "com.typesafe.akka" %% "akka-http" % akkaHttpV, 
    "com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpV, 
    "org.slf4j" % "slf4j-api" % "1.7.21", 
    "org.apache.spark" %% "spark-core" % sparkV, 
    "org.apache.spark" %% "spark-sql" % sparkV, 
    "org.apache.spark" %% "spark-streaming" % sparkV, 
    "org.apache.spark" %% "spark-mllib" % sparkV, 
    "com.github.blemale" %% "scaffeine" % "2.0.0" % "compile", 
    "org.apache.spark" %% "spark-streaming-kafka-0-10" % sparkV , 
    "com.datastax.spark" %% "spark-cassandra-connector" % "2.0.0-M3", 
    "org.json4s" %% "json4s-native" % "3.5.0" , 
    "org.scalatest" %% "scalatest" % "3.0.0" % "test", 
+0

錯誤非常簡單。你正在編譯哪個傑克遜依賴項,以及Spark使用哪一個? –

+1

我還沒有添加任何傑克遜依賴!因此問這個問題! –

+2

嘗試使用[SBT依賴關係圖](https://github.com/jrudolph/sbt-dependency-graph)查看依賴關係,以查看哪個依賴關係正在使用它。 –

回答

2

異常是由傑克遜斯卡拉模塊檢查的一個部署它jackson-databind版本時拋出。 Scala模塊需要相同的次要版本;在這種情況下,異常消息是不完整的(它應該包括兩個版本) - 我猜你有更新的jackson-databind(2.7.8是一個很好的新版本)和舊的Scala模塊,也許是一個Spark包(2.5.3?)。因爲經常「足夠接近」的小版本可以工作:但解決方案是確保數據綁定和Scala模塊具有相同的次版本(並且可能也是相同的修補版本)。

相關問題