{"record":{"id":"f871384153d39b01","repo":"flowable/flowable-engine","slug":"failed-to-read-resource-resource-f87138","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-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/AbstractCmmnAutoDeploymentStrategy.java","lineNumber":56,"sourceCode":"    public AbstractCmmnAutoDeploymentStrategy(CommonAutoDeploymentProperties deploymentProperties) {\n        super(deploymentProperties);\n    }\n\n    @Override\n    protected LockManager getLockManager(CmmnEngine engine, String deploymentNameHint) {\n        return engine.getCmmnEngineConfiguration().getLockManager(determineLockName(deploymentNameHint));\n    }\n\n    protected void addResource(Resource resource, CmmnDeploymentBuilder deploymentBuilder) {\n        String resourceName = determineResourceName(resource);\n        addResource(resource, resourceName, deploymentBuilder);\n    }\n\n    protected void addResource(Resource resource, String resourceName, CmmnDeploymentBuilder 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-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/AbstractCmmnAutoDeploymentStrategy.java#L38-L60","documentation":"During CMMN auto-deployment, each Spring Resource is read as an InputStream and added to the deployment builder. If resource.getInputStream() or the stream copy throws an IOException, the strategy wraps it in an UncheckedIOException with the resource identifier so the failing deployable is named. Deployment is aborted at that point.","triggerScenarios":"Auto-deploying CMMN resources (processes/) where the underlying Resource cannot be read: file deleted between scan and read, unreadable file permissions, broken classpath resource, or an I/O error while streaming.","commonSituations":"CMMN XML files removed from a directory-based resource folder after startup scanning; Docker image or packaged jar missing resources due to build filtering; restrictive file permissions on the deployable resources directory; network-mounted resource drives that drop connections.","solutions":["Verify every resource matched by the auto-deployment resource pattern exists and is readable at deploy time (check file existence and permissions).","Check the resource path/pattern configured for CMMN auto-deployment and correct any wrong classpath or filesystem location.","Rebuild/repackage the artifact so resources are actually present in the jar/war (check maven/gradle resource filtering isn't excluding .cmmn files).","Enable debug logging for the deployment strategy to see which resource failed and inspect the wrapped IOException cause."],"exampleFix":"// before (deployment aborts)\nClassPathResource r = new ClassPathResource(\"processes/missing.cmmn\");\n// after (guard first)\nif (r.exists() && r.isReadable()) {\n    // let auto-deployment include it\n}","handlingStrategy":"try-catch","validationCode":"if (!resource.exists() || !resource.isReadable()) {\n    throw new IllegalStateException(\"CMMN resource not readable: \" + resource);\n}","typeGuard":"boolean isReadableResource(Resource r) {\n    try { return r != null && r.exists() && r.isReadable(); } catch (IOException e) { return false; }\n}","tryCatchPattern":"try {\n    deploymentStrategy.deployResources(deploymentName, resources);\n} catch (UncheckedIOException e) {\n    LOG.error(\"CMMN auto-deployment failed reading resource: \" + e.getMessage(), e.getCause());\n}","preventionTips":["Verify resource files exist and are readable in packaged artifacts (check jar contents) before deployment.","Avoid build filters/excludes that silently drop .cmmn/.resources files.","Check file permissions on external resource directories mounted into the app.","Log resource list at startup so missing files are detected before deploy time."],"tags":["spring","deployment","io","resources"],"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"}