cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.NoSuchMethodError in databricks

sarvesh242
Contributor

I have created a package in scala. Now, I am calling a method from that package and using it in my notebook. During run time, it throws me an error java.lang.NoSuchMethodError. The method exists in the package but still, I am getting this error. Please guide me regarding the same.

1 ACCEPTED SOLUTION

Accepted Solutions

sarvesh242
Contributor

Hi! @Kaniz Fatma​ . I am using scala version 2.11 with spark 2.4.3.

According to Apache spark official website 😞https://spark.apache.org/docs/2.4.3/#:~:text=For%20the%20Scala%20API%2C%20Spark,x.)

Spark 2.4.3 uses Scala 2.12.

(https://spark.apache.org/docs/2.4.0/#:~:text=For%20the%20Scala%20API%2C%20Spark,0%20uses%20Scala%202....)

 Spark 2.4. 0 uses Scala 2.11.

I have two options with respect to Spark/scala version. Does any option has edge over the other ?

Thanks!

View solution in original post

7 REPLIES 7

Kaniz
Community Manager
Community Manager

Hi @sarvesh gakhar​ , Can you please check the scala version?

sarvesh242
Contributor

scala version 2.11 with spark 2.4.3

Kaniz
Community Manager
Community Manager

Hi @sarvesh gakhar​ , The exception often arises if you mix different scala versions. Do you have any dependencies loaded for scala 2.11?

Please check if you have some libraries installed on your cluster that probably used Scala 2.11.

sarvesh242
Contributor

Hi! @Kaniz Fatma​ . I am using dependencies for scala 2.11. Can you please elaborate on the above point

"mixing different scala versions".

Thanks

Kaniz
Community Manager
Community Manager

Hi @sarvesh gakhar​ , I meant Spark and Scala version mismatch.

sarvesh242
Contributor

Hi! @Kaniz Fatma​ . I am using scala version 2.11 with spark 2.4.3.

According to Apache spark official website 😞https://spark.apache.org/docs/2.4.3/#:~:text=For%20the%20Scala%20API%2C%20Spark,x.)

Spark 2.4.3 uses Scala 2.12.

(https://spark.apache.org/docs/2.4.0/#:~:text=For%20the%20Scala%20API%2C%20Spark,0%20uses%20Scala%202....)

 Spark 2.4. 0 uses Scala 2.11.

I have two options with respect to Spark/scala version. Does any option has edge over the other ?

Thanks!

Kaniz
Community Manager
Community Manager

@sarvesh gakhar​ , Just a friendly follow-up. Do you still need help? Please let us know.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!