flowable/flowable-engine · error · UncheckedIOException

Failed to read resource <resource>

Error message

Failed to read resource <resource>

What it means

AbstractDmnAutoDeploymentStrategy.addResource reads a Spring Resource and streams it into a DmnDeploymentBuilder. If Resource.getInputStream() throws IOException (resource missing, unreadable, or closed), it wraps it in UncheckedIOException so auto-deployment aborts with a message naming the failing resource.

Source

Thrown at modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/AbstractDmnAutoDeploymentStrategy.java:56

    public AbstractDmnAutoDeploymentStrategy(CommonAutoDeploymentProperties deploymentProperties) {
        super(deploymentProperties);
    }

    @Override
    protected LockManager getLockManager(DmnEngine engine, String deploymentNameHint) {
        return engine.getDmnEngineConfiguration().getLockManager(determineLockName(deploymentNameHint));
    }

    protected void addResource(Resource resource, DmnDeploymentBuilder deploymentBuilder) {
        String resourceName = determineResourceName(resource);
        addResource(resource, resourceName, deploymentBuilder);
    }

    protected void addResource(Resource resource, String resourceName, DmnDeploymentBuilder deploymentBuilder) {
        try (InputStream inputStream = resource.getInputStream()) {
            deploymentBuilder.addInputStream(resourceName, inputStream);
        } catch (IOException ex) {
            throw new UncheckedIOException("Failed to read resource " + resource, ex);
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify every configured DMN resource location/pattern actually resolves to existing readable files at runtime
  2. Check file permissions and that the file was not deleted between scan and read
  3. Run the app with a working directory/classpath where the resource patterns match
  4. Catch UncheckedIOException at the deployment layer to fail gracefully with the resource path logged

Example fix

// before (broken resource location)
flowable.dmn.resource-locations=classpath:/dmn/*.dmn.xml
// after (location that exists on classpath)
flowable.dmn.resource-locations=classpath:/processes/dmn/*.dmn.xml
Defensive patterns

Strategy: try-catch

Validate before calling

Resource r = applicationContext.getResource(location);
if (r == null || !r.exists()) { throw new IllegalStateException("DMN resource missing: " + location); }

Type guard

boolean readable(Resource r) { try { r.getInputStream().close(); return true; } catch (IOException e) { return false; } }

Try / catch

try { autoDeployResources(app); } catch (UncheckedIOException e) { log.error("DMN autodeploy failed on resource: {}", e.getMessage(), e); }

Prevention

When it happens

Trigger: Spring auto-deployment of DMN resources (e.g. mavenCheckResources/flowable.dmn.resource-location) where a configured Resource pattern resolves to a file that cannot be opened: deleted at runtime, on an unmounted volume, or a directory instead of a file.

Common situations: Misconfigured resource locations in application properties pointing at a non-existent directory; resources removed between pattern matching and read; file permission problems in container images; read-only filesystems.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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