4

I am currently using spring boot 2.3.0 version to build an apache spark job in java. This job is working fine in my local. I want to deploy this spring boot spark job on Azure databricks(7.2.0). But while deploying spring boot jar on Azure databricks, I am getting following error -

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)

I have checked azure databricks documentation, it has spring core 4.1.3 installed by deafult on azure databricks and in my code the spring core version is 5.2.8. So, I want to ask if there is any way I can upgrade spring core version on azure databricks.

nkrivenko
  • 1,231
  • 3
  • 14
  • 23

1 Answers1

0

To make third-party or locally-built code available to notebooks and jobs running on your clusters, you can install a library. Libraries can be written in Python, Java, Scala, and R. You can upload Java, Scala, and Python libraries and point to external packages in PyPI, Maven, and CRAN repositories

Steps to install Spring version in Azure Databricks:

Step1: Download the spring core library from the Maven repository. Click on jar file to download.

enter image description here

Step2: Choose the cluster in which you want to install the library.

Libraries => Install New => Library Source: "Upload", Library Type: "Jar", Click on drop here and choose the previously downloaded jar file => Click install.

enter image description here

Successfully, installed spring_core_5_2_8 library on the cluster.

enter image description here

For different methods to install packages in Azure Databricks, refer: How to install a library on a databricks cluster using some command in the notebook?

CHEEKATLAPRADEEP
  • 12,191
  • 1
  • 19
  • 42
  • 1
    I've tried to start jar with spring boot 2.3.12.RELEASE, added spring_core_5_2_16_RELEASE.jar as library - no success. same error "Uncaught throwable from user code: java.lang.NoSuchMethodError: org.springframework.core.ResolvableType.forInstance" – Triffids Aug 23 '21 at 09:37
  • Yes we can upload library like this but somehow Databricks referring to old spring version in classpath. How to force databricks to pick our jar? – Mdumanoj Mar 24 '22 at 09:07