flowable/flowable-engine · warning · FlowableIllegalArgumentException
deploymentId is null
Error message
deploymentId is null
What it means
FlowableIllegalArgumentException thrown by GetDeploymentResourceNamesCmd.execute when deploymentId is null. The command lists all resource names belonging to a deployment and cannot proceed without an id. Validation happens before the entity manager query.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDeploymentResourceNamesCmd.java:38
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.engine.impl.util.CommandContextUtil;
/**
* @author Joram Barrez
*/
public class GetDeploymentResourceNamesCmd implements Command<List>, Serializable {
private static final long serialVersionUID = 1L;
protected String deploymentId;
public GetDeploymentResourceNamesCmd(String deploymentId) {
this.deploymentId = deploymentId;
}
@Override
public List execute(CommandContext commandContext) {
if (deploymentId == null) {
throw new FlowableIllegalArgumentException("deploymentId is null");
}
return CommandContextUtil.getDeploymentEntityManager(commandContext).getDeploymentResourceNames(deploymentId);
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Null-check the id before calling; throw your own descriptive validation error.
- Resolve a real deploymentId via createDeploymentQuery() filtered by key/name/latest.
- Catch FlowableIllegalArgumentException and map to a 400-style input error.
- Fix upstream data so the id field is always populated where the API is invoked.
Example fix
// before
List<String> names = repositoryService.getDeploymentResourceNames(dep.getId());
// after
if (deploymentId == null) throw new IllegalArgumentException("deploymentId required");
List<String> names = repositoryService.getDeploymentResourceNames(deploymentId); Defensive patterns
Strategy: validation
Validate before calling
if (deploymentId == null || deploymentId.isBlank())
throw new IllegalArgumentException("deploymentId is required");
boolean exists = repositoryService.createDeploymentQuery()
.deploymentId(deploymentId).count() > 0; Type guard
Optional<String> nonBlank(String s) {
return Optional.ofNullable(s).map(String::trim).filter(t -> !t.isEmpty());
} Try / catch
try {
return repositoryService.getDeploymentResourceNames(deploymentId);
} catch (FlowableIllegalArgumentException e) {
throw new BadRequestException("deploymentId is required", e);
} Prevention
- Validate deployment ids before every deployment-scoped call.
- Check query results for null before propagating ids onward.
- Enforce non-blank ids with bean validation on request objects.
- Write tests exercising null/empty id arguments on deployment helpers.
When it happens
Trigger: Calling repositoryService.getDeploymentResourceNames(null) — typically after a lookup that returned no deployment (null id propagated), or a deserialized request missing the id field.
Common situations: REST layer passing an absent path parameter as null; chaining after a failed createDeploymentQuery().singleResult(); importing ids from CSV/JSON where the column is empty.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/11fbb8fdeba397dc.
Report an issue: GitHub.