flowable/flowable-engine · error · ActivitiIllegalArgumentException

resourceNameLike is null

Error message

resourceNameLike is null

What it means

ProcessDefinitionQueryImpl.processDefinitionResourceNameLike(String) throws ActivitiIllegalArgumentException 'resourceNameLike is null' when the LIKE pattern for the resource name is null. The engine validates the argument at query-construction time so the SQL LIKE predicate is always formed from a real string. Passing null breaches the API contract.

Source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java:186

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

    @Override
    public ProcessDefinitionQueryImpl processDefinitionResourceName(String resourceName) {
        if (resourceName == null) {
            throw new ActivitiIllegalArgumentException("resourceName is null");
        }
        this.resourceName = resourceName;
        return this;
    }

    @Override
    public ProcessDefinitionQueryImpl processDefinitionResourceNameLike(String resourceNameLike) {
        if (resourceNameLike == null) {
            throw new ActivitiIllegalArgumentException("resourceNameLike is null");
        }
        this.resourceNameLike = resourceNameLike;
        return this;
    }

    @Override
    public ProcessDefinitionQueryImpl processDefinitionVersion(Integer version) {
        checkVersion(version);
        this.version = version;
        return this;
    }

    @Override
    public ProcessDefinitionQuery processDefinitionVersionGreaterThan(Integer processDefinitionVersion) {
        checkVersion(processDefinitionVersion);
        this.versionGt = processDefinitionVersion;
        return this;
    }

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Provide a non-null LIKE pattern, e.g. "%order%.bpmn20.xml"
  2. Guard the call and skip the filter when the pattern is null
  3. Default the pattern to "%" if 'any resource' is the intended behavior
  4. Catch ActivitiIllegalArgumentException to produce a client-facing validation message

Example fix

// before
query.processDefinitionResourceNameLike(pattern);
// after
if (pattern != null) {
    query.processDefinitionResourceNameLike(pattern);
}
Defensive patterns

Strategy: validation

Validate before calling

if (resourceNameLike == null) throw new IllegalArgumentException("resourceNameLike pattern is required");
query.processDefinitionResourceNameLike(resourceNameLike);

Type guard

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

Try / catch

try {
    query.processDefinitionResourceNameLike(pattern);
} catch (ActivitiIllegalArgumentException e) {
    if (e.getMessage().contains("resourceNameLike is null")) {
        throw new BadRequestException("resourceNameLike pattern must not be null");
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling ProcessDefinitionQuery.processDefinitionResourceNameLike(null), e.g. when the pattern is taken from an absent request parameter or an unset property.

Common situations: Filter UIs passing raw (often null) search inputs; environment-specific config for resource folder patterns that is missing; code that previously built the pattern with String.format on a null argument and now forwards null directly.

Related errors


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