{"record":{"id":"187fd022e828c9c6","repo":"flowable/flowable-engine","slug":"could-not-find-a-resource-with-id-resourceid-i","errorCode":null,"errorMessage":"Could not find a resource with id '<resourceId>' in deployment '<deploymentId>","messagePattern":"Could not find a resource with id '<resourceId>' in deployment '<deploymentId>","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/BaseDecisionResource.java","lineNumber":103,"sourceCode":"        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessDeploymentById(deployment);\n        }\n\n        List<String> resourceList = dmnRepositoryService.getDeploymentResourceNames(deploymentId);\n\n        if (resourceList.contains(resourceId)) {\n            String contentType = contentTypeResolver.resolveContentType(resourceId);\n            response.setContentType(contentType);\n            try (final InputStream resourceStream = dmnRepositoryService.getResourceAsStream(deploymentId, resourceId)) {\n                return IOUtils.toByteArray(resourceStream);\n                \n            } catch (Exception e) {\n                throw new FlowableException(\"Error converting resource stream\", e);\n            }\n        } else {\n            // Resource not found in deployment\n            throw new FlowableObjectNotFoundException(\"Could not find a resource with id '\" + resourceId + \"' in deployment '\" + deploymentId);\n        }\n    }\n}\n","sourceCodeStart":85,"sourceCodeEnd":107,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/BaseDecisionResource.java#L85-L107","documentation":"After loading the deployment, the code lists deployment resources and only proceeds to stream if the requested resourceId is among them; otherwise FlowableObjectNotFoundException(\"Could not find a resource with id '<resourceId>' in deployment '<deploymentId>'\") is thrown. The deployment exists but contains no resource with that id.","triggerScenarios":"GET /dmn-repository/deployments/{deploymentId}/resources/{resourceId} where resourceId is not a resource of that deployment: id copied from another deployment, guessed/truncated id, or a resource name used where an id is required.","commonSituations":"Mixing up resource id and resource name (this endpoint needs the id; BaseDmnDeploymentResourceDataResource takes the name); stale cached resource ids after redeployment; typos in hard-coded ids.","solutions":["List the deployment's resources with GET /dmn-repository/deployments/{deploymentId}/resources and use an id from the response.","If you only have the resource name, use the resource-data-by-name endpoint (BaseDmnDeploymentResourceDataResource) instead.","Refresh cached resource ids after any redeploy; ids change with new deployments."],"exampleFix":"// before\nbyte[] dmn = client.getDeploymentResourceData(deploymentId, \"my.dmn\"); // that's a name, not an id\n// after\nResourceResponse resource = client.getDeploymentResources(deploymentId).stream()\n    .filter(r -> r.getName().equals(\"my.dmn\")).findFirst().orElseThrow();\nbyte[] dmn = client.getDeploymentResourceData(deploymentId, resource.getId());","handlingStrategy":"validation","validationCode":"Set<String> ids = getDeploymentResources(deploymentId).stream()\n    .map(ResourceResponse::getId).collect(toSet());\nif (!ids.contains(resourceId)) throw new IllegalArgumentException(resourceId + \" not in deployment \" + deploymentId);","typeGuard":null,"tryCatchPattern":"try {\n    byte[] data = client.getDeploymentResourceData(deploymentId, resourceId);\n} catch (FlowableObjectNotFoundException e) {\n    resourceId = lookupResourceIdByName(deploymentId, expectedName);\n}","preventionTips":["Use resource ids only from a fresh resources list for that deployment","Don't confuse resource ids with resource names (by-name endpoint exists)","Invalidate cached resource ids after redeployment"],"tags":["rest","not-found","resource"],"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"}