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",
錯誤非常簡單。你正在編譯哪個傑克遜依賴項,以及Spark使用哪一個? –
我還沒有添加任何傑克遜依賴!因此問這個問題! –
嘗試使用[SBT依賴關係圖](https://github.com/jrudolph/sbt-dependency-graph)查看依賴關係,以查看哪個依賴關係正在使用它。 –