flowable/flowable-engine · error · FlowableIllegalArgumentException
Deployment id is null
Error message
Deployment id is null
What it means
SetDeploymentKeyCmd.execute throws FlowableIllegalArgumentException when deploymentId is null. The command sets the key on a deployment and needs a non-null id to load it. Argument-validation guard at the start of execute.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentKeyCmd.java:46
/**
* @author Tijs Rademakers
*/
public class SetDeploymentKeyCmd implements Command<Void> {
protected String deploymentId;
protected String key;
public SetDeploymentKeyCmd(String deploymentId, String key) {
this.deploymentId = deploymentId;
this.key = key;
}
@Override
public Void execute(CommandContext commandContext) {
if (deploymentId == null) {
throw new FlowableIllegalArgumentException("Deployment id is null");
}
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
DeploymentEntity deployment = processEngineConfiguration.getDeploymentEntityManager().findById(deploymentId);
if (deployment == null) {
throw new FlowableObjectNotFoundException("No deployment found for id = '" + deploymentId + "'", Deployment.class);
}
if (Flowable5Util.isFlowable5Deployment(deployment, commandContext)) {
throw new FlowableException("Not supported for version 5 deployments");
}
// Update category
deployment.setKey(key);
FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();
if (eventDispatcher != null && eventDispatcher.isEnabled()) {
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a valid, non-null deployment id string.
- Resolve the id from a deployment query and null-check before invoking.
- Guard API calls in generic helper code with an explicit id check.
Example fix
// before repositoryService.setDeploymentKey(deploymentId, key); // deploymentId null // after Objects.requireNonNull(deploymentId, "deploymentId required"); repositoryService.setDeploymentKey(deploymentId, key);
Defensive patterns
Strategy: validation
Validate before calling
Objects.requireNonNull(deploymentId, "deploymentId must not be null"); repositoryService.setDeploymentKey(deploymentId, key);
Type guard
boolean hasDeploymentId = deploymentId instanceof String && ((String) deploymentId).length() > 0;
Prevention
- Fail fast on missing ids with Objects.requireNonNull at call sites.
- Track deployment ids returned by deployment completion rather than reconstructing them.
- Add id-presence assertions in integration tests that exercise the repository API.
When it happens
Trigger: Calling repositoryService.setDeploymentKey(null, key) or executing new SetDeploymentKeyCmd(null, key).
Common situations: Uninitialized id variable; forwarding a null result of a lookup; misuse of the management/repository API in scripts.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/d28fd82695344d14.
Report an issue: GitHub.