如何解决“java.lang.ClassNotFoundException”使用 databricks-connect 运行 Scala Spark 项目时?
目前我正在学习如何使用databricks-connect在本地使用IDE开发Scala代码。 databricks-connect 的设置如 此处所述 是成功的。这是一个假设,因为我可以毫无问题地对集群运行 PySpark 代码。
但是,我很难运行 Scala 中提供的 scala 示例演示对象。我收到 java.lang.ClassNotFoundException
:这里是异常的完整跟踪:
我的 build.sbt 严格遵循 Databricks-connect 演示提供的内容:
scalaVersion := "2.12.15"
name := "hello-world"
organization := "ch.epfl.scala"
version := "1.0"
//autoScalaLibrary := true
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.1"
unmanagedBase := new java.io.File("/home/clh78p/.local/lib/python3.8/site-packages/pyspark/jars")
mainClass := Some("Main")
我的集群配置是更新,我密切关注以下 databricks-连接客户端安装手册准确。
我读过这里的帖子和这个帖子。它们让我觉得我缺少一些 jar 或库依赖项,而演示中可能未涵盖这些依赖项?我确保 scala 版本匹配,所以这应该不是问题。欢迎任何建议。
请注意,我将 VS Code 与 WSL2 和 Databricks Azure 选项结合使用。我目前正在学习 Scala 以取代 PySpark Notebooks。
Currently I am learning how to use databricks-connect to develop Scala code using IDE locally. The set-up of the databricks-connect as described here was succuesful. This is an assumption as I can run PySpark Code against the cluster with no issues.
However, I struggle to run the scala example as provided in the Scala demo object. I receive the java.lang.ClassNotFoundException
: Here the full trace of the Exception:
My build.sbt follows closely what was provided with the Databricks-connect demo:
scalaVersion := "2.12.15"
name := "hello-world"
organization := "ch.epfl.scala"
version := "1.0"
//autoScalaLibrary := true
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.1"
unmanagedBase := new java.io.File("/home/clh78p/.local/lib/python3.8/site-packages/pyspark/jars")
mainClass := Some("Main")
My clusters configuration is up-date and I payed close attention to following the databricks-connect client installation manual precisely.
I read amongst others the post here and this post. They make me think I am missing some jar or a library dependency which may not be covered in the demo? I made sure the scala versions match, so this should hopefully not be the problem. Any advice is welcome.
Note that I use VS Code with WSL2 and the Databricks Azure option. I am learning Scala at the moment to replace PySpark Notebooks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论