flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided tokenDateAfter is null

Error message

Provided tokenDateAfter is null

What it means

Flowable's TokenQueryImpl.tokenDateAfter(Date tokenDateAfter) throws FlowableIllegalArgumentException when the argument is null. This lower-bound date criterion must be non-null for SQL binding and is validated in the fluent method before execution.

Source

Thrown at modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java:110

            throw new FlowableIllegalArgumentException("Provided token date is null");
        }
        this.tokenDate = tokenDate;
        return this;
    }

    @Override
    public TokenQuery tokenDateBefore(Date tokenDateBefore) {
        if (tokenDateBefore == null) {
            throw new FlowableIllegalArgumentException("Provided tokenDateBefore is null");
        }
        this.tokenDateBefore = tokenDateBefore;
        return this;
    }

    @Override
    public TokenQuery tokenDateAfter(Date tokenDateAfter) {
        if (tokenDateAfter == null) {
            throw new FlowableIllegalArgumentException("Provided tokenDateAfter is null");
        }
        this.tokenDateAfter = tokenDateAfter;
        return this;
    }

    @Override
    public TokenQuery ipAddress(String ipAddress) {
        if (ipAddress == null) {
            throw new FlowableIllegalArgumentException("Provided ip address is null");
        }
        this.ipAddress = ipAddress;
        return this;
    }

    @Override
    public TokenQuery ipAddressLike(String ipAddressLike) {
        if (ipAddressLike == null) {
            throw new FlowableIllegalArgumentException("Provided ipAddressLike is null");

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Check the date before applying the criterion and skip it when null
  2. Resolve a default from-date (e.g. epoch or now minus a window) rather than passing null
  3. Return a 400-style validation error from your API when the from-date is required but missing

Example fix

// before
TokenQuery query = identityService.createTokenQuery().tokenDateAfter(since);
// after
TokenQuery query = identityService.createTokenQuery();
if (since != null) {
    query.tokenDateAfter(since);
}
Defensive patterns

Strategy: validation

Validate before calling

if (since == null) { throw new IllegalArgumentException("since must not be null before tokenDateAfter()"); }

Type guard

boolean hasSince(Date since) { return since != null; }

Try / catch

try { query.tokenDateAfter(since); } catch (FlowableIllegalArgumentException e) { log.warn("Invalid token query: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Calling tokenDateAfter(null) on a TokenQuery, e.g. when an 'since' filter came from an optional request parameter or a failed date parse returned null.

Common situations: Queries for tokens created after a given time in dashboards/reports where the from-date is optional; migration scripts with configurable start dates; deserialization leaving Date fields null.

Related errors


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