java.lang.noclassdeffounderror:com/dataStax/spark/connector/columnselector构建jar

发布于 2025-01-31 10:44:25 字数 461 浏览 4 评论 0原文

我正在使用Spark的Maven Project,将Cassandra用作数据库。 可以使用0错误执行代码,并获得我想要的结果,但是我无法用JAR文件提交项目: 这是我的pom.xml:

pom.xml

我的命令提交项目:

spark-submit --master "local[*]" --class com.sparkfinal.App target/sparkfinal-1.0-SNAPSHOT.jar

错误:

错误

Am using maven project with spark, and a cassandra as a database.
Am able to execute the code with 0 error, and getting the result that I want, but I can't submit the project with the jar file:
here is my pom.xml :

POM.xml

my commands to submit the project:

spark-submit --master "local[*]" --class com.sparkfinal.App target/sparkfinal-1.0-SNAPSHOT.jar

the error:

ERROR

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↘人皮目录ツ 2025-02-07 10:44:25

您都需要:

  1. 创建一个“ nofollow noreferrer”>组装jar 用于您的项目将包含所有依赖项(确保您将Spark依赖项称为提供的)
  2. ,或将Spark Cassandra Connector指定为依赖项,当使用- packages com.datastax.spark.spark:spark-cassandra-- connector_2.12:3.2.0,如连接器的文档

我建议使用第一种方法,因为我看到您还有其他需要提供的依赖项。另外,请注意,您可能不需要指定Java驱动程序依赖性,因为Spark Cassandra连接器将自动拉出。

You need either:

  1. create an assembly jar for your project that will include all dependencies (make sure you declare Spark dependencies as provided)
  2. or specify Spark Cassandra Connector as dependency when submitting the job by using --packages com.datastax.spark:spark-cassandra-connector_2.12:3.2.0 as shown in the connector's docs

I would recommend to use first method because I see that you have other dependencies that you'll need to provide. Also, please note that you may not need to specify java driver dependency as it will be pulled by Spark Cassandra Connector automatically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文