【问题标题】:java.lang.ClassNotFoundException: Failed to find data source: org.apache.bahir.sql.streaming.mqtt.MQTTStreamSinkProvider. Please find packagesjava.lang.ClassNotFoundException:找不到数据源:org.apache.bahir.sql.streaming.mqtt.MQTTStreamSinkProvider。请找包
【发布时间】:2021-12-01 22:52:21
【问题描述】:

我已经添加了

"org.apache.bahir" %% "spark-streaming-mqtt" % "2.4.0"

到我的build.sbt,并使用

df
  .writeStream
  .format("org.apache.bahir.sql.streaming.mqtt.MQTTStreamSinkProvider")
  .outputMode("complete")
  .option("topic", "mytopic")
  .option("brokerUrl", "tcp://localhost:1883")
  .start()
  .awaitTermination(20000)

在代码中,但得到

java.lang.ClassNotFoundException: Failed to find data source: org.apache.bahir.sql.streaming.mqtt.MQTTStreamSinkProvider. Please find packages at http://spark.apache.org/third-party-projects.html

    at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSource(DataSource.scala:679)

【问题讨论】:

    标签: scala apache-spark spark-streaming mqtt apache-bahir


    【解决方案1】:

    我已经意识到这种行为的原因是使用了错误的依赖 "org.apache.bahir" %% "spark-streaming-mqtt" % "2.4.0" 而不是 "org.apache.bahir" %% "spark-sql-streaming-mqtt" % "2.4.0"

    修复后我遇到了新问题

    【讨论】:

      猜你喜欢
      • 2020-06-16
      • 1970-01-01
      • 2018-06-07
      • 2021-03-06
      • 2014-11-28
      • 1970-01-01
      • 2021-08-30
      • 2019-05-11
      • 2018-04-04
      相关资源
      最近更新 更多