flowable/flowable-engine · error · ActivitiIllegalArgumentException
Deployment id is null
Error message
Deployment id is null
What it means
Activiti's DeploymentQueryImpl.deploymentId() validates its argument before building the query. If you pass a null deployment id, the library throws ActivitiIllegalArgumentException immediately rather than issuing a query that cannot match or would return wrong results. This is an early-fail guard for a required query parameter.
Source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DeploymentQueryImpl.java:57
protected boolean withoutTenantId;
protected String processDefinitionKey;
protected String processDefinitionKeyLike;
public DeploymentQueryImpl() {
}
public DeploymentQueryImpl(CommandContext commandContext) {
super(commandContext);
}
public DeploymentQueryImpl(CommandExecutor commandExecutor) {
super(commandExecutor);
}
@Override
public DeploymentQueryImpl deploymentId(String deploymentId) {
if (deploymentId == null) {
throw new ActivitiIllegalArgumentException("Deployment id is null");
}
this.deploymentId = deploymentId;
return this;
}
@Override
public DeploymentQueryImpl deploymentName(String deploymentName) {
if (deploymentName == null) {
throw new ActivitiIllegalArgumentException("deploymentName is null");
}
this.name = deploymentName;
return this;
}
@Override
public DeploymentQueryImpl deploymentNameLike(String nameLike) {
if (nameLike == null) {
throw new ActivitiIllegalArgumentException("deploymentNameLike is null");View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a non-null deployment id string to deploymentId()
- Check for null before calling deploymentId() and skip or branch the query
- Trace where the id comes from and fix the upstream null (unpersisted entity, failed lookup)
- If the filter is optional, only add it when the id is present
Example fix
// before
DeploymentQuery q = repositoryService.createDeploymentQuery().deploymentId(request.getDeploymentId());
// after
DeploymentQuery q = repositoryService.createDeploymentQuery();
if (request.getDeploymentId() != null) {
q = q.deploymentId(request.getDeploymentId());
} Defensive patterns
Strategy: validation
Validate before calling
if (deploymentId == null) { throw new IllegalArgumentException("deploymentId must not be null"); }
repositoryService.createDeploymentQuery().deploymentId(deploymentId)... Type guard
boolean hasDeploymentId(String id) { return id != null && !id.trim().isEmpty(); } Try / catch
try {
Deployment d = repositoryService.createDeploymentQuery().deploymentId(id).singleResult();
} catch (ActivitiIllegalArgumentException e) {
log.error("Invalid deployment query argument", e);
} Prevention
- Null-check ids at API/DTO boundaries before reaching the engine
- Make id fields @NotNull-validated in request objects
- Never pass optional filters unconditionally; wrap in null checks
When it happens
Trigger: Calling repositoryService.createDeploymentQuery().deploymentId(null), typically when the id variable was never assigned, came from an optional request parameter, or a previous lookup (e.g. processInstance.getDeploymentId()) returned null.
Common situations: REST/DTO layers mapping optional 'deploymentId' query params straight into the API; code that resolved a deployment id from an entity that has no deployment; refactors that removed an id assignment upstream.
Related errors
- deploymentName is null
- deploymentNameLike is null
- deploymentCategory is null
- deploymentCategoryExclude is null
- key is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/5cb05e7d5e07eef7.
Report an issue: GitHub.