flowable/flowable-engine · error · ActivitiIllegalArgumentException
key is null
Error message
key is null
What it means
DeploymentQueryImpl.processDefinitionKey() throws ActivitiIllegalArgumentException when the key argument is null. Even though this is a DeploymentQuery, it can filter by process definition key, and that key must be a concrete non-null value to build the predicate.
Source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DeploymentQueryImpl.java:126
@Override
public DeploymentQueryImpl deploymentTenantIdLike(String tenantIdLike) {
if (tenantIdLike == null) {
throw new ActivitiIllegalArgumentException("deploymentTenantIdLike is null");
}
this.tenantIdLike = tenantIdLike;
return this;
}
@Override
public DeploymentQueryImpl deploymentWithoutTenantId() {
this.withoutTenantId = true;
return this;
}
@Override
public DeploymentQueryImpl processDefinitionKey(String key) {
if (key == null) {
throw new ActivitiIllegalArgumentException("key is null");
}
this.processDefinitionKey = key;
return this;
}
@Override
public DeploymentQueryImpl processDefinitionKeyLike(String keyLike) {
if (keyLike == null) {
throw new ActivitiIllegalArgumentException("keyLike is null");
}
this.processDefinitionKeyLike = keyLike;
return this;
}
// sorting ////////////////////////////////////////////////////////
@Override
public DeploymentQuery orderByDeploymentId() {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a non-null process definition key
- Guard the call: only add the filter when the key is present
- Validate the key at the API boundary before invoking the query
- Fix the upstream lookup that should have produced the key
Example fix
// before
DeploymentQuery q = repositoryService.createDeploymentQuery().processDefinitionKey(defKey);
// after
DeploymentQuery q = repositoryService.createDeploymentQuery();
if (defKey != null) {
q = q.processDefinitionKey(defKey);
} Defensive patterns
Strategy: validation
Validate before calling
if (processDefinitionKey == null) { throw new IllegalArgumentException("processDefinitionKey must not be null"); }
repositoryService.createDeploymentQuery().processDefinitionKey(processDefinitionKey)... Type guard
boolean hasText(String s) { return s != null && !s.trim().isEmpty(); } Try / catch
try {
repositoryService.createDeploymentQuery().processDefinitionKey(key).list();
} catch (ActivitiIllegalArgumentException e) {
log.error("process definition key was null", e);
} Prevention
- Validate the key at the API boundary
- Only apply optional key filters when present
- Verify upstream lookups actually return the key before use
When it happens
Trigger: Calling repositoryService.createDeploymentQuery().processDefinitionKey(null), typically when the definition key was resolved from a nullable variable, request parameter, or a failed lookup on a process definition entity.
Common situations: Pages that query deployments for an optional selected process definition; keys read from process variables or forms that were never set; refactor replacing a hardcoded key with a parameter defaulting to null.
Related errors
- Deployment id is null
- deploymentName is null
- deploymentNameLike is null
- deploymentCategory is null
- deploymentCategoryExclude is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/0ba2e3d693d7780e.
Report an issue: GitHub.