flowable/flowable-engine · error · ActivitiIllegalArgumentException

deploymentCategory is null

Error message

deploymentCategory is null

What it means

DeploymentQueryImpl.deploymentCategory() throws ActivitiIllegalArgumentException when the deploymentCategory argument is null. Categories are optional filters, but once you invoke this method the library requires a concrete value for the query predicate.

Source

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

            throw new ActivitiIllegalArgumentException("deploymentName is null");
        }
        this.name = deploymentName;
        return this;
    }

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

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

    @Override
    public DeploymentQueryImpl deploymentCategoryNotEquals(String deploymentCategoryNotEquals) {
        if (deploymentCategoryNotEquals == null) {
            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");

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a non-null category string
  2. Only add the category filter when a value is configured/present
  3. Set an explicit category at deployment time (DeploymentBuilder.category(...)) so downstream queries have a value
  4. Fix the config source returning null for the category

Example fix

// before
DeploymentQuery q = repositoryService.createDeploymentQuery().deploymentCategory(props.getCategory());
// after
DeploymentQuery q = repositoryService.createDeploymentQuery();
String category = props.getCategory();
if (category != null) {
    q = q.deploymentCategory(category);
}
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

boolean hasCategory(Properties p) { return p.getProperty("deployment.category") != null; }

Try / catch

try {
    repositoryService.createDeploymentQuery().deploymentCategory(category).list();
} catch (ActivitiIllegalArgumentException e) {
    log.error("deploymentCategory was null", e);
}

Prevention

When it happens

Trigger: Calling repositoryService.createDeploymentQuery().deploymentCategory(null), typically when category is an optional configuration or request parameter forwarded unchecked.

Common situations: Multi-tenant setups where category is configurable; deployments made without a category and code assuming a default value exists; missing property in a config file.

Related errors


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