flowable/flowable-engine · error · ActivitiIllegalArgumentException

deploymentTenantIdLike is null

Error message

deploymentTenantIdLike is null

What it means

DeploymentQueryImpl.deploymentTenantIdLike() throws ActivitiIllegalArgumentException when the tenantIdLike argument is null. The like-pattern for tenant filtering must be a non-null string; null cannot form a SQL LIKE predicate.

Solutions

  1. Pass a non-null pattern string
  2. Conditionally add the filter only when a pattern is provided
  3. Default the prefix to an explicit sentinel value if wildcard semantics are wanted
  4. Correct the config/input source that yields null

Example fix

// before
query.deploymentTenantIdLike(tenantPrefix + "%");
// after
if (tenantPrefix != null) {
    query.deploymentTenantIdLike(tenantPrefix + "%");
}
Defensive patterns

Strategy: validation

Validate before calling

if (tenantIdLike == null) { throw new IllegalArgumentException("tenantIdLike must not be null"); }
repositoryService.createDeploymentQuery().deploymentTenantIdLike(tenantIdLike)...

Type guard

boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }

Try / catch

try {
    repositoryService.createDeploymentQuery().deploymentTenantIdLike(pattern).list();
} catch (ActivitiIllegalArgumentException e) {
    log.error("tenantIdLike pattern was null", e);
}

Prevention

When it happens

Trigger: Calling repositoryService.createDeploymentQuery().deploymentTenantIdLike(null), e.g. building a tenant prefix pattern from a nullable prefix variable.

Common situations: Tenant prefix searches (tenantIdLike("acme-%")) where the prefix comes from config that is unset; dynamic query builders always invoking the filter method.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DeploymentQueryImpl.java:111

            throw new ActivitiIllegalArgumentException("deploymentCategoryExclude is null");
        }
        this.categoryNotEquals = deploymentCategoryNotEquals;
        return this;
    }

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

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

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

    @Override
    public DeploymentQueryImpl processDefinitionKey(String key) {
        if (key == null) {
            throw new ActivitiIllegalArgumentException("key is null");
        }
        this.processDefinitionKey = key;
        return this;

View on GitHub (pinned to d6d39ce1c6)