jenkinsci/jenkins · error · IOException

Unable to load {} from {}

Error message

Unable to load {} from {}

What it means

IOException thrown when ClassLoader.loadClass fails with LinkageError or ClassNotFoundException for the manifest's Plugin-Class. The named class could not be found in the plugin's classloader, or linkage (verification/resolution) failed, so the plugin cannot be instantiated.

Source

Thrown at core/src/main/java/hudson/ClassicPluginStrategy.java:391

        // override the context classloader. This no longer makes sense,
        // but it is left for the backward compatibility
        ClassLoader old = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(wrapper.classLoader);
        try {
            String className = wrapper.getPluginClass();
            if (className == null) {
                // use the default dummy instance
                wrapper.setPlugin(new DummyImpl());
            } else {
                try {
                    Class<?> clazz = wrapper.classLoader.loadClass(className);
                    Object o = clazz.getDeclaredConstructor().newInstance();
                    if (!(o instanceof Plugin)) {
                        throw new IOException(className + " doesn't extend from hudson.Plugin");
                    }
                    wrapper.setPlugin((Plugin) o);
                } catch (LinkageError | ClassNotFoundException e) {
                    throw new IOException("Unable to load " + className + " from " + wrapper.getShortName(), e);
                } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
                    throw new IOException("Unable to create instance of " + className + " from " + wrapper.getShortName(), e);
                }
            }

            // initialize plugin
            try {
                Plugin plugin = wrapper.getPluginOrFail();
                plugin.setServletContext(pluginManager.context);
                startPlugin(wrapper);
            } catch (Throwable t) {
                // gracefully handle any error in plugin.
                throw new IOException("Failed to initialize", t);
            }
        } finally {
            Thread.currentThread().setContextClassLoader(old);
        }
    }

View on GitHub (pinned to 2e228ff40b)

Solutions

  1. Check the plugin's dependencies and build against the Jenkins core version actually running (match API baseline).
  2. Inspect the archive to confirm the Plugin-Class is present and its dependencies are bundled in WEB-INF/lib.
  3. Upgrade Jenkins core or downgrade the plugin to a compatible release line.
Defensive patterns

Strategy: try-catch

Validate before calling

// Before instantiating, confirm the class is loadable in the plugin classloader
try {
    Class<?> c = wrapper.classLoader.loadClass(className);
} catch (ClassNotFoundException | LinkageError e) {
    throw new IOException("Plugin-Class " + className + " is missing; check dependencies", e);
}

Try / catch

try {
    Class<?> clazz = wrapper.classLoader.loadClass(className);
} catch (LinkageError | ClassNotFoundException e) {
    // align plugin build with the running Jenkins core / bundled deps
}

Prevention

When it happens

Trigger: Plugin-Class names a class that does not exist in the archive, or the class exists but references missing/incompatible types causing a LinkageError (e.g. IncompatibleClassChangeError, NoClassDefFoundError for a dependency).

Common situations: Plugin depends on a library or Jenkins API version not present at runtime; class renamed/moved between plugin builds; dependency shaded away; plugin built against a newer Jenkins core than the running controller.

Related errors


AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14). Data as JSON: /api/errors/7d90a1682e044569. Report an issue: GitHub.