flowable/flowable-engine · error · ActivitiObjectNotFoundException
No deployment found for id = '" + deploymentId + "'
Error message
No deployment found for id = '" + deploymentId + "'
What it means
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.
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.
Example fix
// before
repositoryService.setDeploymentCategory(deploymentId, "hr");
// after
Deployment d = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
if (d != null) {
repositoryService.setDeploymentCategory(deploymentId, "hr");
} Defensive patterns
Strategy: validation
Validate before calling
Deployment d = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
if (d == null) throw new IllegalArgumentException("No deployment " + deploymentId); Try / catch
try { repositoryService.setDeploymentCategory(deploymentId, category); }
catch (ActivitiObjectNotFoundException e) { log.warn("deployment {} not found", deploymentId); } Prevention
- Always resolve ids through a query before mutating
- Verify database/environment consistency
- Treat stored deployment ids as volatile across redeploys
When it happens
Trigger: 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).
Common situations: 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.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Could not find a deployment with id ''.
- Could not find a deployment with id '" + deploymentId + "'.
- Could not find a deployment with id
- Could not find a deployment with id
- Could not find a deployment with id
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/c106e00ddaf52502.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetDeploymentCategoryCmd.java:50
public SetDeploymentCategoryCmd(String deploymentId, String category) {
this.deploymentId = deploymentId;
this.category = category;
}
@Override
public Void execute(CommandContext commandContext) {
if (deploymentId == null) {
throw new ActivitiIllegalArgumentException("Deployment id is null");
}
DeploymentEntity deployment = commandContext
.getDeploymentEntityManager()
.findDeploymentById(deploymentId);
if (deployment == null) {
throw new ActivitiObjectNotFoundException("No deployment found for id = '" + deploymentId + "'", Deployment.class);
}
// Update category
deployment.setCategory(category);
if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, deployment),
EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);
}
return null;
}
public String getDeploymentId() {
return deploymentId;
}
View on GitHub (pinned to d6d39ce1c6)