jeecgboot/JeecgBoot · error · ParseException

Increment >= 24 : {incr}

Error message

Increment >= 24 : {incr}

What it means

checkIncrementRange rejects a step value greater than 23 for the HOUR field, since hours range 0-23. A '/24' or '/48' step is invalid. Message echoes the increment.

Source

Thrown at jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java:730

                    ValueSet vs = getValue(val, s, i);
                    val = vs.value;
                    i = vs.pos;
                }
                i = checkNext(i, s, val, type);
                return i;
            }
        } else {
            throw new ParseException("Unexpected character: " + c, i);
        }

        return i;
    }

    private void checkIncrementRange(int incr, int type, int idxPos) throws ParseException {
        if (incr > 59 && (type == SECOND || type == MINUTE)) {
            throw new ParseException("Increment >= 60 : " + incr, idxPos);
        } else if (incr > 23 && (type == HOUR)) {
            throw new ParseException("Increment >= 24 : " + incr, idxPos);
        } else if (incr > 31 && (type == DAY_OF_MONTH)) {
            throw new ParseException("Increment >= 31 : " + incr, idxPos);
        } else if (incr > 7 && (type == DAY_OF_WEEK)) {
            throw new ParseException("Increment >= 7 : " + incr, idxPos);
        } else if (incr > 12 && (type == MONTH)) {
            throw new ParseException("Increment >= 12 : " + incr, idxPos);
        }
    }

    protected int checkNext(int pos, String s, int val, int type)
            throws ParseException {

        int end = -1;
        int i = pos;

        if (i >= s.length()) {
            addToSet(val, end, -1, type);
            return i;

View on GitHub (pinned to 96fb33f5ec)

Solutions

  1. Cap hour steps at 23; common ones are '/2', '/4', '/6', '/12'.
  2. For 'every N days at HH:MM' use the day-of-month field with a step (e.g. '0 0 8 1/2 * ?' = every 2 days at 08:00).
  3. Clamp computed hourly steps to 1-23.

Example fix

// before - hour step > 23
String cron = "0 0 0/24 * * ?";  // Increment >= 24 : 24

// after - every 12 hours
String cron = "0 0 0/12 * * ?";
Defensive patterns

Strategy: validation

Validate before calling

// HOUR field step must be <= 23.
public static String validateHourStep(String hourField) {
    return validateStepRange(hourField, 23);
}
// (validateStepRange as defined in error 295)

Type guard

public static boolean hourStepValid(String hourField) {
    return stepWithinMax(hourField, 23);
}

Try / catch

try {
    new CronExpression(expr);
} catch (ParseException e) {
    if (e.getMessage().startsWith("Increment >= 24")) {
        return "Hour steps must be <= 23; for multi-day intervals use the day-of-month step. " + e.getMessage();
    }
    throw e;
}

Prevention

When it happens

Trigger: Hour step out of range: '0 0 0/24 * * ?', '0 0 0/48 * * ?', or a computed hourly interval > 23 placed in the hour field.

Common situations: Trying to express 'every day at a time' as a 24-hour step (instead use a dom step or just a fixed hour); dynamic interval math that overflows the hour range; confusing hours with days.

Related errors


AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14). Data as JSON: /api/errors/b3a984293eeb9ce0. Report an issue: GitHub.