flowable/flowable-engine · error · ClassNotFoundException

from bundle

Error message

 from bundle 

What it means

BundleDelegatingClassLoader.loadClass first tries the bundle's own classloader (findClass); if that fails it delegates to the wrapped parent classLoader. When both fail, it rethrows ClassNotFoundException('<name> from bundle <id> (<symbolicName>)') with the original as cause, pinpointing which OSGi bundle could not provide the class.

Source

Thrown at modules/flowable-osgi/src/main/java/org/flowable/osgi/blueprint/BundleDelegatingClassLoader.java:126

        if (urls == null) {
            urls = Collections.enumeration(new ArrayList<>());
        }

        return urls;
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
        Class clazz;
        try {
            clazz = findClass(name);
        } catch (ClassNotFoundException cnfe) {
            if (classLoader != null) {
                try {
                    clazz = classLoader.loadClass(name);
                } catch (ClassNotFoundException e) {
                    throw new ClassNotFoundException(name + " from bundle " + bundle.getBundleId() + " (" + bundle.getSymbolicName() + ")", cnfe);
                }
            } else {
                throw new ClassNotFoundException(name + " from bundle " + bundle.getBundleId() + " (" + bundle.getSymbolicName() + ")", cnfe);
            }
        }
        if (resolve) {
            resolveClass(clazz);
        }
        return clazz;
    }

    public Bundle getBundle() {
        return bundle;
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Add the required package to the bundle's Import-Package (or add the containing bundle via Require-Bundle)
  2. Deploy the jar/bundle containing the missing class into the OSGi container
  3. Check the symbolic name and bundle id in the message to identify which bundle needs fixing
  4. Verify package versions in the manifest match the exported version of the providing bundle

Example fix

// before (MANIFEST.MF)
Import-Package: com.google.common.base
// after
Import-Package: com.google.common.collect;version="[25.0,26)"
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the class is resolvable before use
Class<?> c;
try { c = bundle.loadClass(className); }
catch (ClassNotFoundException e) { throw new IllegalStateException("Missing import for " + className + " in bundle " + bundle.getSymbolicName(), e); }

Try / catch

try {
    Class<?> clazz = delegatingLoader.loadClass(name);
} catch (ClassNotFoundException e) {
    // message format: "<name> from bundle <id> (<symbolicName>)"
    logger.error("Class {} not found; add its package to Import-Package of bundle {}", name, e.getMessage(), e);
    throw e;
}

Prevention

When it happens

Trigger: Loading a class through BundleDelegatingClassLoader where neither the bundle nor its delegate classloader can resolve the class name — e.g. during script compilation or process behavior instantiation inside an OSGi container.

Common situations: Missing Import-Package/Require-Bundle for the needed class; dependency jar not deployed in the OSGi container; class exists in the container but the bundle does not import it; version mismatch where the class was moved to a different package.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/d43cc56420ce2714. Report an issue: GitHub.