{"record":{"id":"18fcc818c661f813","repo":"flowable/flowable-engine","slug":"failed-to-read-resource-resource-18fcc8","errorCode":null,"errorMessage":"Failed to read resource <resource>","messagePattern":"Failed to read resource <resource>","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/AbstractDmnAutoDeploymentStrategy.java","lineNumber":56,"sourceCode":"    public AbstractDmnAutoDeploymentStrategy(CommonAutoDeploymentProperties deploymentProperties) {\n        super(deploymentProperties);\n    }\n\n    @Override\n    protected LockManager getLockManager(DmnEngine engine, String deploymentNameHint) {\n        return engine.getDmnEngineConfiguration().getLockManager(determineLockName(deploymentNameHint));\n    }\n\n    protected void addResource(Resource resource, DmnDeploymentBuilder deploymentBuilder) {\n        String resourceName = determineResourceName(resource);\n        addResource(resource, resourceName, deploymentBuilder);\n    }\n\n    protected void addResource(Resource resource, String resourceName, DmnDeploymentBuilder deploymentBuilder) {\n        try (InputStream inputStream = resource.getInputStream()) {\n            deploymentBuilder.addInputStream(resourceName, inputStream);\n        } catch (IOException ex) {\n            throw new UncheckedIOException(\"Failed to read resource \" + resource, ex);\n        }\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":60,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/AbstractDmnAutoDeploymentStrategy.java#L38-L60","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify every configured DMN resource location/pattern actually resolves to existing readable files at runtime","Check file permissions and that the file was not deleted between scan and read","Run the app with a working directory/classpath where the resource patterns match","Catch UncheckedIOException at the deployment layer to fail gracefully with the resource path logged"],"exampleFix":"// before (broken resource location)\nflowable.dmn.resource-locations=classpath:/dmn/*.dmn.xml\n// after (location that exists on classpath)\nflowable.dmn.resource-locations=classpath:/processes/dmn/*.dmn.xml","handlingStrategy":"try-catch","validationCode":"Resource r = applicationContext.getResource(location);\nif (r == null || !r.exists()) { throw new IllegalStateException(\"DMN resource missing: \" + location); }","typeGuard":"boolean readable(Resource r) { try { r.getInputStream().close(); return true; } catch (IOException e) { return false; } }","tryCatchPattern":"try { autoDeployResources(app); } catch (UncheckedIOException e) { log.error(\"DMN autodeploy failed on resource: {}\", e.getMessage(), e); }","preventionTips":["Verify resource-location globs resolve to files in the target environment","Avoid deleting/moving DMN files while the application is running","Check container file permissions for DMN resource directories"],"tags":["io","resource","spring","dmn-deployment"],"backgroundTag":"file-read-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}