flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided token date is null

Error message

Provided token date is null

What it means

Flowable's TokenQueryImpl.tokenDate(Date tokenDate) throws FlowableIllegalArgumentException when the tokenDate argument is null. An exact-match date criterion must be non-null to be bound as a query parameter. The validation runs inside the fluent method, before any database access.

Solutions

  1. Parse and validate the date before calling tokenDate, rejecting invalid input in your own layer
  2. Use tokenDateBefore/tokenDateAfter for range filtering, applying them only when non-null
  3. Omit the criterion when the date is absent to query without a date filter

Example fix

// before
TokenQuery query = identityService.createTokenQuery().tokenDate(date);
// after
TokenQuery query = identityService.createTokenQuery();
if (date != null) {
    query.tokenDate(date);
} else {
    // handle missing date input
}
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

boolean hasDate(Date d) { return d != null; }

Try / catch

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

Prevention

When it happens

Trigger: Calling tokenDate(null) on a TokenQuery, e.g. when a timestamp parsed from a request or configuration was null because parsing failed or the field was absent.

Common situations: Filtering tokens by creation date where the date comes from optional request parameters; date fields lost in JSON deserialization; timezone/parsing utilities returning null on failure.

Related errors


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

Appendix: source

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

            throw new FlowableIllegalArgumentException("Provided ids is null");
        }
        this.ids = ids;
        return this;
    }

    @Override
    public TokenQuery tokenValue(String tokenValue) {
        if (tokenValue == null) {
            throw new FlowableIllegalArgumentException("Provided token value is null");
        }
        this.tokenValue = tokenValue;
        return this;
    }

    @Override
    public TokenQuery tokenDate(Date tokenDate) {
        if (tokenDate == null) {
            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");

View on GitHub (pinned to d6d39ce1c6)