flowable/flowable-engine · error · FlowableException

resource '${resource}' doesn't exist

Error message

resource '${resource}' doesn't exist

What it means

ResourceStreamSource loads a classpath resource as an InputStream for DMN deployment. If ClassLoader.getResourceAsStream returns null, the resource does not exist on the classpath and a FlowableException("resource '<name>' doesn't exist") is thrown.

Source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/io/ResourceStreamSource.java:36

import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.impl.util.io.StreamSource;

/**
 * @author Joram Barrez
 */
public class ResourceStreamSource implements StreamSource {

    String resource;

    public ResourceStreamSource(String resource) {
        this.resource = resource;
    }

    @Override
    public InputStream getInputStream() {
        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(resource);
        if (inputStream == null) {
            throw new FlowableException("resource '" + resource + "' doesn't exist");
        }
        return new BufferedInputStream(inputStream);
    }

    @Override
    public String toString() {
        return "Resource[" + resource + "]";
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the resource path string matches its location on the classpath exactly (case-sensitive)
  2. Ensure the .dmn file is included in the built artifact (check Maven/Gradle resource includes)
  3. Read the deployment code to confirm whether it expects a classpath-relative path and adjust the path accordingly
  4. List classpath contents at runtime (getClass().getClassLoader().getResource(...)) to debug path resolution

Example fix

// before
repositoryService.createDeployment().addClasspathResource("decisions/riskTable.dmn").deploy();
// after (path matches actual src/main/resources layout)
repositoryService.createDeployment().addClasspathResource("dmn/decisions/riskTable.dmn").deploy();
Defensive patterns

Strategy: validation

Validate before calling

String path = "dmn/model.dmn";
if (getClass().getClassLoader().getResource(path) == null) throw new IllegalStateException("classpath resource missing: " + path);

Try / catch

try { repo.createDeployment().addClasspathResource(path).deploy(); } catch (FlowableException e) { if (e.getMessage().contains("doesn't exist")) { /* fix path/packaging */ } throw e; }

Prevention

When it happens

Trigger: Deploying a DMN model via a resource name (e.g. sourceResource/resource deployment) where the named file is not present in the application classpath at runtime.

Common situations: Typo in the resource path or missing leading directory (e.g. 'dmn/decision.dmn' vs 'decision.dmn'); resource exists in src/test/resources but not packaged into the deployed artifact; WAR/JAR packaging excluding .dmn files; file name case mismatch on case-sensitive filesystems.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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