{"record":{"id":"8aa5ba6a16b0b555","repo":"flowable/flowable-engine","slug":"could-not-find-a-dmn-deployment-with-id-deployme","errorCode":null,"errorMessage":"Could not find a DMN deployment with id '<deploymentId>","messagePattern":"Could not find a DMN 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/BaseDmnDeploymentResourceDataResource.java","lineNumber":59,"sourceCode":"    \n    @Autowired(required=false)\n    protected DmnRestApiInterceptor restApiInterceptor;\n\n    protected byte[] getDmnDeploymentResourceData(String deploymentId, String resourceName, HttpServletResponse response) {\n\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"No deployment id provided\");\n        }\n        if (resourceName == null) {\n            throw new FlowableIllegalArgumentException(\"No resource name 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 DMN 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(resourceName)) {\n            String contentType = contentTypeResolver.resolveContentType(resourceName);\n            response.setContentType(contentType);\n            try (final InputStream resourceStream = dmnRepositoryService.getResourceAsStream(deploymentId, resourceName)) {\n                return IOUtils.toByteArray(resourceStream);\n                \n            } catch (Exception e) {\n                throw new FlowableException(\"Error converting resource stream\", e);\n            }\n            ","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/BaseDmnDeploymentResourceDataResource.java#L41-L77","documentation":"The deployment existence check in getDmnDeploymentResourceData throws FlowableObjectNotFoundException(\"Could not find a DMN deployment with id '<deploymentId>'\") when DmnDeploymentQuery.deploymentId(...).singleResult() returns null. The supplied deployment id matches no row in the DMN engine's deployment table.","triggerScenarios":"GET /dmn-repository/deployments/{deploymentId}/resource-data/{resourceName} with a nonexistent deploymentId: deleted deployment, id belonging to the BPMN process engine rather than the DMN engine, wrong database/environment, or truncated id.","commonSituations":"After DB switch or tenant-specific datasource misroute; cleanup jobs purging old deployments; copying ids between dev/test environments; confusing process deployments with DMN deployments (separate tables).","solutions":["Confirm the id exists via GET /dmn-repository/deployments before requesting resource data.","Verify the REST app's datasource points at the environment where the DMN deployment lives.","Re-deploy the DMN model if the deployment was deleted and use the returned deployment id.","If the id came from the process engine API, use the corresponding process REST API instead."],"exampleFix":"// before\nbyte[] data = client.getDmnDeploymentResourceData(\"123\", \"d.dmn\"); // nonexistent in this env\n// after\nDmnDeploymentResponse dep = client.getDeployment(\"123\");\nif (dep == null) {\n    DmnDeploymentResponse created = client.deploy(new ClassPathResource(\"d.dmn\"));\n    return client.getDmnDeploymentResourceData(created.getId(), \"d.dmn\");\n}","handlingStrategy":"try-catch","validationCode":"boolean exists = dmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).count() > 0;\nif (!exists) deployDmnModel(...); // or refetch id","typeGuard":null,"tryCatchPattern":"try {\n    return client.getDmnDeploymentResourceData(deploymentId, resourceName);\n} catch (FlowableObjectNotFoundException e) {\n    deploymentId = redeployAndGetId(resourceName); // deployment gone: redeploy\n}","preventionTips":["Look up deployment ids dynamically instead of persisting them across environments","Check for auto-cleanup jobs that delete DMN deployments your code depends on","Don't reuse process-engine deployment ids with the DMN REST API"],"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"}