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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group