flowable/flowable-engine · error · ActivitiIllegalArgumentException
Deployment id is null
Error message
Deployment id is null
What it means
SetDeploymentCategoryCmd changes a deployment's category, but first rejects a null deploymentId with ActivitiIllegalArgumentException. The deployment id is the key used to look up the deployment entity.
Solutions
- Pass a valid, non-null deployment id obtained from the Deployment object returned by RepositoryService.createDeployment().deploy().
- Guard the call site: only call setDeploymentCategory when the id is known non-null.
- Fix the config/code path that yields a null deployment id.
Example fix
// before
repositoryService.setDeploymentCategory(deploymentId, "my-category"); // deploymentId may be null
// after
if (deploymentId != null) {
repositoryService.setDeploymentCategory(deploymentId, "my-category");
} Defensive patterns
Strategy: validation
Validate before calling
if (deploymentId == null || deploymentId.isEmpty()) throw new IllegalArgumentException("deploymentId required"); Try / catch
try { repositoryService.setDeploymentCategory(deploymentId, category); }
catch (ActivitiIllegalArgumentException e) { log.error("deployment id missing"); } Prevention
- Capture the deployment id directly from the returned Deployment object
- Validate ids before any repositoryService call
- Avoid passing ids sourced from unresolved config placeholders
When it happens
Trigger: Calling RepositoryService.setDeploymentCategory(null, category) or executing SetDeploymentCategoryCmd with a null deploymentId.
Common situations: Deployment id read from config/property that was never set, or a variable expected to hold the deployment id being null after a failed deployment lookup.
Related errors
- bytes array is null
- bytes array is null
- bytes is null
- channel definition bytes is null
- cmmn bytes is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/bae06cbef2a78917.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetDeploymentCategoryCmd.java:42
/**
* @author Tijs Rademakers
*/
public class SetDeploymentCategoryCmd implements Command<Void> {
protected String deploymentId;
protected String category;
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);
}
View on GitHub (pinned to d6d39ce1c6)