{"record":{"id":"10099ad198517c82","repo":"flowable/flowable-engine","slug":"deployment-does-not-exist-10099a","errorCode":null,"errorMessage":"deployment does not exist: ","messagePattern":"deployment does not exist: ","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetDeploymentResourceCmd.java","lineNumber":52,"sourceCode":"    public GetDeploymentResourceCmd(String deploymentId, String resourceName) {\n        this.deploymentId = deploymentId;\n        this.resourceName = resourceName;\n    }\n\n    @Override\n    public InputStream execute(CommandContext commandContext) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n        if (resourceName == null) {\n            throw new FlowableIllegalArgumentException(\"resourceName is null\");\n        }\n\n        CmmnResourceEntity resource = CommandContextUtil.getCmmnResourceEntityManager(commandContext)\n                .findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);\n        if (resource == null) {\n            if (CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).findById(deploymentId) == null) {\n                throw new FlowableObjectNotFoundException(\"deployment does not exist: \" + deploymentId, CmmnDeploymentEntity.class);\n            } else {\n                throw new FlowableObjectNotFoundException(\"no resource found with name '\" + resourceName + \"' in deployment '\" + deploymentId + \"'\", CmmnResourceEntity.class);\n            }\n        }\n        return new ByteArrayInputStream(resource.getBytes());\n    }\n\n}\n","sourceCodeStart":34,"sourceCodeEnd":61,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetDeploymentResourceCmd.java#L34-L61","documentation":"After the resource lookup returns null, this command checks whether the deployment itself exists. If findById(deploymentId) is null, it throws FlowableObjectNotFoundException indicating the deploymentId references no deployed CMMN deployment. The exception carries CmmnDeploymentEntity.class as the missing type.","triggerScenarios":"Calling CmmnRepositoryService.getResource(deploymentId, resourceName) with a deploymentId that does not exist in ACT_CMMN_DEPLOYMENT (e.g. an arbitrary or already-cleaned-up id), with both arguments non-null.","commonSituations":"Using a process (BPMN) deployment id against the CMMN repository service; stale ids after database recreation or deployment cleanup; hardcoded ids from another environment.","solutions":["Verify the deploymentId exists via cmmnRepositoryService.createDeploymentQuery().deploymentId(id).singleResult() before fetching the resource","List deployments with createDeploymentQuery().list() and use a valid id","Fix cross-environment id confusion (test vs prod database)"],"exampleFix":"// before\nInputStream is = cmmnRepositoryService.getResource(\"42\", \"case.cmmn\"); // id does not exist\n// after\nCmmnDeployment d = cmmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\nif (d != null) {\n    InputStream is = cmmnRepositoryService.getResource(deploymentId, \"case.cmmn\");\n}","handlingStrategy":"validation","validationCode":"boolean exists = cmmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).count() > 0;","typeGuard":null,"tryCatchPattern":"try { return cmmnRepositoryService.getResource(deploymentId, name); } catch (FlowableObjectNotFoundException e) { if (e.getCauseClass() != null) log.warn(\"Deployment {} not found\", deploymentId); return null; }","preventionTips":["Store deployment ids returned by deploy() rather than reconstructing them","Confirm you are using the CMMN repository service for CMMN deployments, not the BPMN one","Re-check ids after database rebuilds or environment switches"],"tags":["not-found","cmmn","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"}