{"record":{"id":"e104c7e19d7d38e1","repo":"flowable/flowable-engine","slug":"resource-resource-doesn-t-exist","errorCode":null,"errorMessage":"resource '${resource}' doesn't exist","messagePattern":"resource '(.+?)' doesn't exist","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/io/ResourceStreamSource.java","lineNumber":36,"sourceCode":"import org.flowable.common.engine.api.FlowableException;\nimport org.flowable.common.engine.impl.util.io.StreamSource;\n\n/**\n * @author Joram Barrez\n */\npublic class ResourceStreamSource implements StreamSource {\n\n    String resource;\n\n    public ResourceStreamSource(String resource) {\n        this.resource = resource;\n    }\n\n    @Override\n    public InputStream getInputStream() {\n        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(resource);\n        if (inputStream == null) {\n            throw new FlowableException(\"resource '\" + resource + \"' doesn't exist\");\n        }\n        return new BufferedInputStream(inputStream);\n    }\n\n    @Override\n    public String toString() {\n        return \"Resource[\" + resource + \"]\";\n    }\n}\n","sourceCodeStart":18,"sourceCodeEnd":46,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/io/ResourceStreamSource.java#L18-L46","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the resource path string matches its location on the classpath exactly (case-sensitive)","Ensure the .dmn file is included in the built artifact (check Maven/Gradle resource includes)","Read the deployment code to confirm whether it expects a classpath-relative path and adjust the path accordingly","List classpath contents at runtime (getClass().getClassLoader().getResource(...)) to debug path resolution"],"exampleFix":"// before\nrepositoryService.createDeployment().addClasspathResource(\"decisions/riskTable.dmn\").deploy();\n// after (path matches actual src/main/resources layout)\nrepositoryService.createDeployment().addClasspathResource(\"dmn/decisions/riskTable.dmn\").deploy();","handlingStrategy":"validation","validationCode":"String path = \"dmn/model.dmn\";\nif (getClass().getClassLoader().getResource(path) == null) throw new IllegalStateException(\"classpath resource missing: \" + path);","typeGuard":null,"tryCatchPattern":"try { repo.createDeployment().addClasspathResource(path).deploy(); } catch (FlowableException e) { if (e.getMessage().contains(\"doesn't exist\")) { /* fix path/packaging */ } throw e; }","preventionTips":["Check resource paths are case-sensitive and package-relative","Ensure build config packages .dmn resources into the artifact","Prefer addClasspathResource over manual StreamSource paths"],"tags":["classpath","resource-not-found","deployment","dmn"],"backgroundTag":"resource-not-found","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"}