{"record":{"id":"f4cd73a9cd1134e5","repo":"flowable/flowable-engine","slug":"could-not-find-a-deployment-with-id-deploymentid-f4cd73","errorCode":null,"errorMessage":"Could not find a deployment with id '<deploymentId>","messagePattern":"Could not find a deployment with id '<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":83,"sourceCode":"        \n        return decision;\n    }\n\n    protected byte[] getDeploymentResourceData(String deploymentId, String resourceId, HttpServletResponse response) {\n\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"No deployment id provided\");\n        }\n        if (resourceId == null) {\n            throw new FlowableIllegalArgumentException(\"No resource id provided\");\n        }\n\n        // Check if deployment exists\n        DmnDeploymentQuery deploymentQuery = dmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId);\n        \n        DmnDeployment deployment = deploymentQuery.singleResult();\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a deployment with id '\" + deploymentId);\n        }\n        \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 {","sourceCodeStart":65,"sourceCodeEnd":101,"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#L65-L101","documentation":"After validating ids, getDeploymentResourceData queries DmnDeploymentQuery.deploymentId(deploymentId).singleResult(); if no DMN deployment matches, FlowableObjectNotFoundException is thrown with that id in the message. It means the deployment id does not exist in the DMN engine's ACT_DMN_DEPLOYMENT table (note the message omits the closing quote, a known cosmetic quirk).","triggerScenarios":"GET /dmn-repository/deployments/{deploymentId}/resources/{resourceId} with a deploymentId that matches no deployment: deleted deployment, id from a process-engine (not DMN) deployment, truncated id, or environment pointing at a different database.","commonSituations":"Using a BPMN process deployment id against the DMN REST API (separate deployment tables); the deployment was removed by a cleanup job or cascade-delete; staging vs production database confusion; hard-coded ids from another environment.","solutions":["Verify the id by listing deployments: GET /dmn-repository/deployments and confirm the id exists.","If you have a BPMN deployment id, query the process-engine REST API instead — DMN deployments are stored separately.","Check your datasource configuration points at the database where the deployment was made.","Re-deploy the DMN artifact if the deployment was deleted, then use the new deployment id."],"exampleFix":"// before\nbyte[] data = client.getDeploymentResourceData(\"8a5c...oldId\", resourceId); // id deleted\n// after\nDmnDeploymentResponse dep = client.getDeployment(deploymentId); // 404 surfaces early\nif (dep == null) {\n    deploymentId = deployDmnModel(new ClassPathResource(\"my.dmn\")).getId();\n}\nbyte[] data = client.getDeploymentResourceData(deploymentId, resourceId);","handlingStrategy":"try-catch","validationCode":"// pre-check\nDmnDeployment dep = dmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\nif (dep == null) throw new IllegalStateException(\"Unknown DMN deployment: \" + deploymentId);","typeGuard":null,"tryCatchPattern":"try {\n    byte[] data = client.getDeploymentResourceData(deploymentId, resourceId);\n} catch (FlowableObjectNotFoundException e) {\n    // message starts with 'Could not find a deployment with id' -> refetch deployment list\n}","preventionTips":["Resolve deployment ids dynamically via the deployments list endpoint instead of hard-coding","Remember DMN deployments are separate from BPMN process deployments","Confirm datasource/environment before calling with ids from another system"],"tags":["rest","not-found","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-14T11:17:12.474Z"}