cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Could not initialize class error

Mohit_m
Valued Contributor II

User is running a job triggered from ADF in Databricks. In this job they need to use custom libraries that are in jars. Most of the times jobs are running fine, however sometimes it fails with:

java.lang.NoClassDefFoundError: Could not initialize

Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions

Mohit_m
Valued Contributor II

Can you please check if there are more than one jar containing this class . If multiple jars of the same type are available on the cluster, then there is no guarantee of JVM picking the proper classes for processing, which results in the intermittent behaviour of job run.

View solution in original post

2 REPLIES 2

Mohit_m
Valued Contributor II

Can you please check if there are more than one jar containing this class . If multiple jars of the same type are available on the cluster, then there is no guarantee of JVM picking the proper classes for processing, which results in the intermittent behaviour of job run.

I have a similar issue.

There is an intermittent issue with NoClassDefFoundError which looks like it's coming after several layers of ObjectInputStream.readObject -- perhaps trying to deserialize a reference in a shuffled object

The class appears once in a JAR, which is deployed once as a Library JAR for the job.

Most of the time it works fine, holding everything else constant, but there are occasional failures with this error. What could cause this failure to be intermittent and not consistent?

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.