flowable/flowable-engine · error · FlowableIllegalArgumentException

Deployment id is null

Error message

Deployment id is null

What it means

FlowableIllegalArgumentException thrown by CmmnDeploymentQueryImpl.deploymentId when the deploymentId argument is null. The query API requires a concrete deployment id to filter CMMN deployments; null cannot be translated into a SQL filter. It is fail-fast argument validation on the query builder.

Solutions

  1. Ensure a valid, non-null deployment id is available before querying
  2. Look up the id via a deployment query or process variable first and check for null
  3. Skip the deploymentId filter if filtering by id is optional in your logic

Example fix

// before
CmmnDeployment d = repoService.createDeploymentQuery().deploymentId(request.getParameter("id")).singleResult();
// after
String id = request.getParameter("id");
if (id != null) { CmmnDeployment d = repoService.createDeploymentQuery().deploymentId(id).singleResult(); }
Defensive patterns

Strategy: validation

Validate before calling

Objects.requireNonNull(deploymentId, "deploymentId required");

Type guard

static boolean validDeploymentId(String id) { return id != null && !id.trim().isEmpty(); }

Try / catch

try {
    query.deploymentId(deploymentId);
} catch (FlowableIllegalArgumentException e) {
    if ("Deployment id is null".equals(e.getMessage())) {
        throw new IllegalArgumentException("A non-null deployment id is required", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling cmmnRepositoryService.createDeploymentQuery().deploymentId(null), often because the id came from a variable/request parameter/lookup that was null.

Common situations: Reading a deployment id from a request or configuration that was not set, chaining a query after a failed lookup returned null, wiring bugs passing uninitialized fields.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/b714ae30b2236986. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/repository/CmmnDeploymentQueryImpl.java:63

    protected String parentDeploymentIdLike;
    protected List<String> parentDeploymentIds;
    protected boolean latest;

    public CmmnDeploymentQueryImpl() {
    }

    public CmmnDeploymentQueryImpl(CommandContext commandContext) {
        super(commandContext);
    }

    public CmmnDeploymentQueryImpl(CommandExecutor commandExecutor) {
        super(commandExecutor);
    }

    @Override
    public CmmnDeploymentQueryImpl deploymentId(String deploymentId) {
        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("Deployment id is null");
        }
        this.deploymentId = deploymentId;
        return this;
    }
    
    @Override
    public CmmnDeploymentQueryImpl deploymentIds(List<String> deploymentIds) {
        if (deploymentIds == null) {
            throw new FlowableIllegalArgumentException("Deployment ids is null");
        }
        this.deploymentIds = deploymentIds;
        return this;
    }

    @Override
    public CmmnDeploymentQueryImpl deploymentName(String deploymentName) {
        if (deploymentName == null) {
            throw new FlowableIllegalArgumentException("deploymentName is null");

View on GitHub (pinned to d6d39ce1c6)