{"record":{"id":"83aa92a5c55329fc","repo":"flowable/flowable-engine","slug":"could-not-find-a-resource-with-name-resourcenam-83aa92","errorCode":null,"errorMessage":"Could not find a resource with name '${resourceName}' in deployment '${deploymentId}'.","messagePattern":"Could not find a resource with name '(.+?)' in deployment '(.+?)'\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/BaseDeploymentResourceDataResource.java","lineNumber":78,"sourceCode":"        if (restApiInterceptor != null) {\n            restApiInterceptor.accessDeploymentById(deployment);\n        }\n\n        List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);\n\n        if (resourceList.contains(resourceName)) {\n            String contentType = contentTypeResolver.resolveContentType(resourceName);\n            response.setContentType(contentType);\n            try (final InputStream resourceStream = repositoryService.getResourceAsStream(deploymentId, resourceName)) {\n                return IOUtils.toByteArray(resourceStream);\n                \n            } catch (Exception e) {\n                throw new FlowableException(\"Error converting resource stream\", e);\n            }\n            \n        } else {\n            // Resource not found in deployment\n            throw new FlowableObjectNotFoundException(\"Could not find a resource with name '\" + resourceName + \"' in deployment '\" + deploymentId + \"'.\", String.class);\n        }\n    }\n}\n","sourceCodeStart":60,"sourceCodeEnd":82,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/BaseDeploymentResourceDataResource.java#L60-L82","documentation":"If the requested resourceName is not present in the given deployment (checked via repositoryService.getResourceAsStream returning null / resource list), FlowableObjectNotFoundException is thrown with the resource name and deployment id embedded. The deployment exists but does not contain a resource with that exact name.","triggerScenarios":"GET /repository/deployments/{deploymentId}/resourcedata/{resourceName} where the resource name doesn't match any entry in the deployment (wrong name, wrong path prefix like 'bpmn/', or resource belongs to a different deployment).","commonSituations":"Guessing resource names instead of listing them (names include folder prefixes); requesting a resource from a different deployment; case-sensitive mismatch on some databases.","solutions":["List actual resources with GET /repository/deployments/{deploymentId}/resources and copy the exact name.","Include the correct path prefix (e.g. 'bpmn/my-process.bpmn20.xml') exactly as listed.","Confirm the resource belongs to this deployment id, not another one.","Handle HTTP 404 by falling back to the resource listing endpoint."],"exampleFix":"// before\nGET /repository/deployments/2501/resourcedata/process.bpmn20.xml\n// after\nGET /repository/deployments/2501/resourcedata/bpmn/process.bpmn20.xml // full name from resources list","handlingStrategy":"validation","validationCode":"const res = (await get(`/repository/deployments/${deploymentId}/resources`)).data;\nconst entry = res.data.find(r => r.url.endsWith('/' + encodeURIComponent(resourceName)) || r.id === resourceName);\nif (!entry) throw new Error(`Resource ${resourceName} not in deployment ${deploymentId}`);","typeGuard":null,"tryCatchPattern":"try { return await getResourceData(deploymentId, name); }\ncatch (e) { if (e.status === 404) return listResources(deploymentId); throw e; }","preventionTips":["Always look up the exact resource id/name from the deployment's resources endpoint first.","Remember resource names include folder prefixes (e.g. 'bpmn/').","Match names exactly, including case."],"tags":["rest-api","not-found","resource","deployment"],"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-18T11:17:12.947Z"}