flowable/flowable-engine · error · FlowableIllegalArgumentException

deploymentTenantId is null

Error message

deploymentTenantId is null

What it means

Thrown by CmmnDeploymentQueryImpl.deploymentTenantId(null). Tenant filtering requires an explicit tenant id string; null is rejected so the generated query never contains a meaningless tenant predicate.

Solutions

  1. Pass a non-null tenant id string to deploymentTenantId()
  2. Skip the call entirely when no tenant filtering is wanted
  3. Check tenant resolution logic to ensure the id is populated before querying

Example fix

// before
query.deploymentTenantId(tenantId); // may be null
// after
if (tenantId != null) {
    query.deploymentTenantId(tenantId);
}
Defensive patterns

Strategy: validation

Validate before calling

Objects.requireNonNull(tenantId, "deploymentTenantId must not be null");
query.deploymentTenantId(tenantId);

Type guard

boolean hasTenant = tenantId != null && !tenantId.isEmpty();

Try / catch

try {
    query.deploymentTenantId(tenantId);
} catch (FlowableIllegalArgumentException e) {
    // proceed without tenant filter or report missing tenant context
}

Prevention

When it happens

Trigger: Calling deploymentTenantId(null), usually when multi-tenant context resolution failed or the tenant id was never set on the request/context object.

Common situations: Multi-tenant applications where the tenant id is resolved at runtime; calling this setter from a non-tenant context; forgetting to use deploymentTenantIdLike for pattern matching.

Related errors


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

Appendix: source

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

            throw new FlowableIllegalArgumentException("deploymentCategoryExclude is null");
        }
        this.categoryNotEquals = deploymentCategoryNotEquals;
        return this;
    }
    
    @Override
    public CmmnDeploymentQueryImpl deploymentKey(String deploymentKey) {
        if (deploymentKey == null) {
            throw new FlowableIllegalArgumentException("deploymentKey is null");
        }
        this.key = deploymentKey;
        return this;
    }

    @Override
    public CmmnDeploymentQueryImpl deploymentTenantId(String tenantId) {
        if (tenantId == null) {
            throw new FlowableIllegalArgumentException("deploymentTenantId is null");
        }
        this.tenantId = tenantId;
        return this;
    }

    @Override
    public CmmnDeploymentQueryImpl deploymentTenantIdLike(String tenantIdLike) {
        if (tenantIdLike == null) {
            throw new FlowableIllegalArgumentException("deploymentTenantIdLike is null");
        }
        this.tenantIdLike = tenantIdLike;
        return this;
    }

    @Override
    public CmmnDeploymentQueryImpl deploymentWithoutTenantId() {
        this.withoutTenantId = true;
        return this;

View on GitHub (pinned to d6d39ce1c6)