Previous load of class failed Error in Salesforce

Previous load of class failed



line -1, column -1: Previous load of class failed, Generally Salesforce developers see this issue while executing test classes, during deployments and installing managed packages in you Salesforce organization. During the deployments all test classes will fail with same issue in your Salesforce organization.




What is the root cause for this issue? Invalid classes/triggers will cause this type issues in your Salesforce organization.

How to get the invalid classes in your Org? Use below query to find the invalid classes/triggers in your org.
For Classes: SELECT IsValid,Name FROM ApexClass WHERE IsValid = false
For Triggers: SELECT IsValid,Name FROM ApexTrigger WHERE IsValid = false

Execute this query in Developer Console or workbench. To get the correct list of classes/triggers by using this query, Compile all classes before you execute the query.



How to compile all classes? To compile all classes go to setup -> Apex Classes and click compile all classes link.

Previous Load Of Class Failed