{"record":{"id":"c106e00ddaf52502","repo":"flowable/flowable-engine","slug":"no-deployment-found-for-id-deploymentid-c106e0","errorCode":null,"errorMessage":"No deployment found for id = '\" + deploymentId + \"'","messagePattern":"No deployment found for id = '\" \\+ deploymentId \\+ \"'","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetDeploymentCategoryCmd.java","lineNumber":50,"sourceCode":"\r\n    public SetDeploymentCategoryCmd(String deploymentId, String category) {\r\n        this.deploymentId = deploymentId;\r\n        this.category = category;\r\n    }\r\n\r\n    @Override\r\n    public Void execute(CommandContext commandContext) {\r\n\r\n        if (deploymentId == null) {\r\n            throw new ActivitiIllegalArgumentException(\"Deployment id is null\");\r\n        }\r\n\r\n        DeploymentEntity deployment = commandContext\r\n                .getDeploymentEntityManager()\r\n                .findDeploymentById(deploymentId);\r\n\r\n        if (deployment == null) {\r\n            throw new ActivitiObjectNotFoundException(\"No deployment found for id = '\" + deploymentId + \"'\", Deployment.class);\r\n        }\r\n\r\n        // Update category\r\n        deployment.setCategory(category);\r\n\r\n        if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {\r\n            commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(\r\n                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, deployment),\r\n                    EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r\n    public String getDeploymentId() {\r\n        return deploymentId;\r\n    }\r\n\r","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetDeploymentCategoryCmd.java#L32-L68","documentation":"SetDeploymentCategoryCmd looks up the deployment by id via DeploymentEntityManager.findDeploymentById; if no deployment exists, it throws ActivitiObjectNotFoundException (an ActivitiObjectNotFound variant) including the id and Deployment.class as the missing type.","triggerScenarios":"RepositoryService.setDeploymentCategory(deploymentId, category) with an id that does not match any deployment in ACT_RE_DEPLOYMENT (e.g. wrong database, deleted deployment, or typo in id).","commonSituations":"Storing a deployment id across environments, deployments cleaned up by a maintenance job, pointing the app at a different database/schema than the one where the deployment was created.","solutions":["Verify the deployment id via RepositoryService.createDeploymentQuery().deploymentId(id).singleResult() before setting the category.","Confirm the engine is connected to the same database where the deployment exists.","Re-deploy the process if the deployment was deleted, then use the new deployment id."],"exampleFix":"// before\nrepositoryService.setDeploymentCategory(deploymentId, \"hr\");\n// after\nDeployment d = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\nif (d != null) {\n    repositoryService.setDeploymentCategory(deploymentId, \"hr\");\n}","handlingStrategy":"validation","validationCode":"Deployment d = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\nif (d == null) throw new IllegalArgumentException(\"No deployment \" + deploymentId);","typeGuard":null,"tryCatchPattern":"try { repositoryService.setDeploymentCategory(deploymentId, category); }\ncatch (ActivitiObjectNotFoundException e) { log.warn(\"deployment {} not found\", deploymentId); }","preventionTips":["Always resolve ids through a query before mutating","Verify database/environment consistency","Treat stored deployment ids as volatile across redeploys"],"tags":["deployment","not-found","repository-service"],"backgroundTag":"entity-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"}