flowable/flowable-engine · error · FlowableIllegalArgumentException
deploymentId is null
Error message
deploymentId is null
What it means
DeleteDeploymentCmd validates its deploymentId argument before delegating to the DeploymentManager. If the caller passes null, it throws FlowableIllegalArgumentException("deploymentId is null") immediately. This is a pure argument-validation error, not a lookup failure.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/DeleteDeploymentCmd.java:37
import org.flowable.common.engine.impl.interceptor.CommandContext;
/**
* @author Joram Barrez
*/
public class DeleteDeploymentCmd implements Command<Void> {
protected String deploymentId;
protected boolean cascade;
public DeleteDeploymentCmd(String deploymentId, boolean cascade) {
this.deploymentId = deploymentId;
this.cascade = cascade;
}
@Override
public Void execute(CommandContext commandContext) {
if (deploymentId == null) {
throw new FlowableIllegalArgumentException("deploymentId is null");
}
CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);
cmmnEngineConfiguration.getDeploymentManager().removeDeployment(deploymentId, cascade);
return null;
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Assert/validate deploymentId is non-null and non-empty before calling deleteDeployment
- Trace where the id comes from (deployment response, config, DB) and fix the null source
- Guard with a repositoryService.createDeploymentQuery().deploymentId(id) existence check
Example fix
// before
repositoryService.deleteDeployment(deploymentId);
// after
if (deploymentId != null && !deploymentId.isEmpty()) {
repositoryService.deleteDeployment(deploymentId);
} Defensive patterns
Strategy: validation
Validate before calling
Objects.requireNonNull(deploymentId, "deploymentId must not be null"); repositoryService.deleteDeployment(deploymentId);
Type guard
boolean isValidId(String id) { return id != null && !id.trim().isEmpty(); } Try / catch
try { repositoryService.deleteDeployment(deploymentId, cascade); }
catch (FlowableIllegalArgumentException e) { if ("deploymentId is null".equals(e.getMessage())) { throw new IllegalStateException("caller passed null deploymentId", e); } throw e; } Prevention
- Validate ids at API boundaries with Objects.requireNonNull
- Check deploy results before scheduling deletes
- Avoid optional/null-returning sources for deployment ids
When it happens
Trigger: Calling CmmnRepositoryService.deleteDeployment(null) or deleteDeployment(null, cascade), typically when the id variable was never populated (failed deploy, unmapped result).
Common situations: Deploy result object not checked before delete; configuration property or DB column holding null used as the id; refactor renamed a variable leaving it uninitialized.
Related errors
- Must specify a case instance id to migrate
- Must specify a case instance migration document to migrate
- Must specify a case definition id to migrate
- caseInstanceId is null
- type is required when deleting a process identity link
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/296a2f93e530a5b3.
Report an issue: GitHub.