{"record":{"id":"b6ed229d2e16a7b9","repo":"flowable/flowable-engine","slug":"resource-resource-not-found","errorCode":null,"errorMessage":"resource '${resource}' not found","messagePattern":"resource '(.+?)' not found","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDeploymentBuilderImpl.java","lineNumber":76,"sourceCode":"            throw new FlowableException(\"could not get byte array from resource '\" + resourceName + \"'\", e);\n        }\n\n        if (bytes == null) {\n            throw new FlowableException(\"byte array for resource '\" + resourceName + \"' is null\");\n        }\n\n        AppResourceEntity resource = resourceEntityManager.create();\n        resource.setName(resourceName);\n        resource.setBytes(bytes);\n        deployment.addResource(resource);\n        return this;\n    }\n\n    @Override\n    public AppDeploymentBuilder addClasspathResource(String resource) {\n        try (final InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(resource)) {\n            if (inputStream == null) {\n                throw new FlowableException(\"resource '\" + resource + \"' not found\");\n            }\n            \n            return addInputStream(resource, inputStream);\n            \n        } catch (IOException ex) {\n            throw new FlowableException(\"Failed to read resource \" + resource, ex);\n        }\n    }\n\n    @Override\n    public AppDeploymentBuilder addString(String resourceName, String text) {\n        if (text == null) {\n            throw new FlowableException(\"text is null\");\n        }\n\n        AppResourceEntity resource = resourceEntityManager.create();\n        resource.setName(resourceName);\n        resource.setBytes(text.getBytes(StandardCharsets.UTF_8));","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDeploymentBuilderImpl.java#L58-L94","documentation":"addClasspathResource() looks up the given resource on the classloader; when getResourceAsStream returns null the resource does not exist on the classpath, and the builder throws FlowableException(\"resource '...' not found\"). This is the standard 'file not on classpath' failure when deploying app archives programmatically.","triggerScenarios":"deploymentBuilder.addClasspathResource(\"myApp.bar\") where the name is misspelled, lacks the correct path prefix (e.g. needs 'app/myApp.bar'), differs in case, or the file was not packaged into the jar/war.","commonSituations":"Resource placed outside src/main/resources so it never lands in the artifact; typos or absolute filesystem paths passed instead of classpath-relative names; case-sensitive filesystems vs. case-insensitive dev machines; resources filtered out by Maven/Gradle resource config.","solutions":["Check the exact classpath-relative path and spelling; getResourceAsStream is case-sensitive and root-relative.","Move the file into src/main/resources (or the equivalent source set) and rebuild so it is packaged.","Verify packaging: open the built jar/war and confirm the resource is present at the expected path.","Check Maven resource filtering/exclusions or Gradle processResources config aren't excluding the file.","Confirm existence first with getClass().getClassLoader().getResource(resource) before deploying."],"exampleFix":"// before\ndeploymentBuilder.addClasspathResource(\"MyApp.bar\"); // actual path: apps/myApp.bar\n\n// after\ndeploymentBuilder.addClasspathResource(\"apps/myApp.bar\");","handlingStrategy":"validation","validationCode":"if (getClass().getClassLoader().getResource(resource) == null) { throw new IllegalStateException(\"Classpath resource not found: \" + resource); }","typeGuard":null,"tryCatchPattern":"try { deploymentBuilder.addClasspathResource(resource); } catch (FlowableException e) { log.error(\"Resource {} missing from classpath; check packaging\", resource); }","preventionTips":["Use classpath-root-relative, case-correct paths; never absolute filesystem paths.","Verify the resource is inside the built jar/war (unzip -l target/app.jar) before deploying.","Check Maven/Gradle resource filtering and exclusions when files go missing.","Add an integration test that resolves every deployed resource name before release."],"tags":["flowable","deployment","classpath","resource-not-found"],"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"}