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: 

Random NoClassDefFound Error when running job

abaet
New Contributor

We are running a job on a cluster with DBR 10.4 LTS Spark 3.2.1 and scala 2.12. Cluster is using 4 workers (spot instances) .The driver is not a spot instance

Randomly ( only on one environment and not all executions), we are getting the following error : java.lang.NoClassDefFoundError: Could not initialize class path.to.one.of.our.Class$

The class does exists and is present in the jar we are loading as a dependant library in the job task definition. The jar was compiled with the same versions (3.2.1/2.12)

The environment is identical to other working ones and as I 've mentionned, just relaunching the same failing job  once makes it succeed, without changing anything.

Any ideas regarding what could the problem possibly be ?

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @abaet

  • The error message suggests that the class failed to initialize. Check if there’s any uncaught exception during static initialization (e.g., in a static block or when creating static variables). If an exception occurs during class loading, it can lead to this error1.
  • Verify that the static block in your PropHolder class (or any other class involved) doesn’t throw an exception. You might need to add proper exception handling to identify the issue.
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!