Jenkins "ClassNotFoundException" After Plugin Update
After a plugin update, Jenkins could not find a class a plugin or pipeline expected, raising ClassNotFoundException or NoClassDefFoundError.
What this error means
A build or the UI fails with java.lang.ClassNotFoundException naming a class, often right after upgrading or downgrading a plugin.
jenkins
java.lang.ClassNotFoundException: org.jenkinsci.plugins.old.LegacyStep
at jenkins.util.AntClassLoader.findClassInComponentsCommon causes
Class moved or removed
The updated plugin renamed or deleted a class that other code still references.
Missing dependency plugin
A plugin providing the class was not installed or loaded.
Stale serialized pipeline state
A resumed build references a class that no longer exists at the new version.
How to fix it
Align plugin versions
- Install the dependency that provides the missing class, or roll the plugin back to a compatible version.
- Restart Jenkins after changing plugins.
Clear stale resumable builds
- Abort and restart builds that were paused across the upgrade so they do not resume against removed classes.
How to prevent it
- Test plugin upgrades on staging and avoid mixing plugin versions that reference classes removed across releases.
Related guides
Jenkins "Plugin failed to load" Missing DependencyFix the Jenkins "Failed to load" plugin error caused by a missing or too-old dependency plugin that the faili…
Jenkins "java.lang.NoSuchMethodError" in a Pipeline BuildFix the Jenkins java.lang.NoSuchMethodError thrown at runtime in a pipeline, usually from a plugin or core ve…
Jenkins "No such DSL method found among steps" Pipeline ErrorFix the Jenkins "No such DSL method X found among steps" error caused by a missing plugin, a misspelled step…