【问题标题】:Spring Version in Azure databricksAzure 数据块中的 Spring 版本
【发布时间】:2021-02-18 03:05:37
【问题描述】:

我目前正在使用 spring boot 2.3.0 版本在 java 中构建一个 apache spark 作业。这份工作在我当地工作得很好。我想在 Azure databricks(7.2.0) 上部署这个 Spring Boot Spark 作业。但是在 Azure databricks 上部署 spring boot jar 时,出现以下错误 -

ava.lang.NoSuchMethodError: org.springframework.core.ResolvableType.forInstance(Ljava/lang/Object;)Lorg/springframework/core/ResolvableType;
    at org.springframework.context.event.SimpleApplicationEventMulticaster.resolveDefaultEventType(SimpleApplicationEventMulticaster.java:145)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
    at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:74)
    at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:47)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:305)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)

我检查了 azure databricks 文档,它在 azure databricks 上默认安装了 spring core 4.1.3,在我的代码中 spring core 版本是 5.2.8。所以,我想问一下有没有什么办法可以在azure databricks上升级spring core版本。

【问题讨论】:

    标签: azure spring-boot apache-spark databricks azure-databricks


    【解决方案1】:

    要使第三方或本地构建的代码可用于集群上运行的笔记本和作业,您可以安装一个库。库可以用 Python、Java、Scala 和 R 编写。您可以上传 Java、Scala 和 Python 库并指向 PyPI、Maven 和 CRAN 存储库中的外部包

    在 Azure Databricks 中安装 Spring 版本的步骤:

    第一步:从 Maven 仓库下载 spring 核心库。点击jar文件下载。

    第 2 步:选择要在其中安装库的集群。

    Libraries => Install New => Library Source: "Upload", Library Type: "Jar"​​, 点击 drop here 并选择之前下载的 jar 文件 => 点击 install。

    成功,在集群上安装spring_core_5_2_8库。

    有关在 Azure Databricks 中安装包的不同方法,请参阅:How to install a library on a databricks cluster using some command in the notebook?

    【讨论】:

    • 我尝试使用 spring boot 2.3.12.RELEASE 启动 jar,添加 spring_core_5_2_16_RELEASE.jar 作为库 - 没有成功。同样的错误“用户代码中未捕获的可抛出:java.lang.NoSuchMethodError:org.springframework.core.ResolvableType.forInstance”
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-26
    • 2018-05-05
    • 1970-01-01
    • 2022-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多