Cron Atlas

Quartz error A step longer than the field

Increment >= 60 : 90

java.lang.RuntimeException: CronExpression '0 0/90 * * * ?' is invalid.
Caused by: java.text.ParseException: Increment >= 60 : 90
java.lang.RuntimeException: CronExpression '0 0 0/24 * * ?' is invalid.
Caused by: java.text.ParseException: Increment >= 24 : 24

Message produced by running the expression through org.quartz.CronExpression from Quartz 2.5.2.

What it means

A step like 0/90 means “start at 0, then every 90”, but it only counts within one field. The minute field stops at 59, so Quartz rejects any minute or second step of 60 or more, and any hour step of 24 or more. The number after the colon is the step you wrote.

An interval that doesn’t fit inside an hour, or a day, can’t be written as one step. When it divides the day evenly, two expressions on the same job can cover it.

Rejected expressions and their fixes

Each expression opens in the tester. The message under a rejected one is what Quartz 2.5.2 printed for it.

  1. Rejected0 0/60 * * * ?Increment >= 60 : 60
    Use
    0 0 * * * ?Every hour, on the hour.

    Every 60 minutes is every hour on the hour.

  2. Rejected0 0/90 * * * ?Increment >= 60 : 90
    Use both
    0 0 0/3 * * ?Every 3 hours.
    and
    0 30 1/3 * * ?Every 3 hours at minute 30, from 01:30.

    Every 90 minutes from midnight: on the hour every third hour from 00:00, and at half past every third hour from 01:00. Give the job both triggers. More on this schedule.

  3. Rejected0 0 0/24 * * ?Increment >= 24 : 24
    Use
    0 0 0 * * ?At 00:00.

    Every 24 hours is once a day.

Questions

How do I run every 90 minutes in Quartz?
With two cron triggers on one job: 0 0 0/3 * * ? and 0 30 1/3 * * ?. Together they fire at 00:00, 01:30, 03:00 and so on. A SimpleTrigger with a 90-minute interval also works, but it counts from its start time rather than the clock.
Is 0/30 the same as */30 in Quartz?
Yes. Both mean 0 and 30, because the step starts at the bottom of the field and stops at its top.

Other Quartz errors

Reference