flowable/flowable-engine · error · ParseException

Support for specifying 'L' and 'LW' with other days of the m

Error message

Support for specifying 'L' and 'LW' with other days of the month is not implemented

What it means

During buildExpression tokenization, the day-of-month field containing 'L' with a length > 1 and a comma (e.g. 'L-3,15') is rejected: combining 'L' (last day) or 'LW' semantics with other listed days of the month is not implemented in this Quartz-derived parser. It surfaces as a ParseException with error offset -1.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java:493

                months = new TreeSet<>();
            }
            if (daysOfWeek == null) {
                daysOfWeek = new TreeSet<>();
            }
            if (years == null) {
                years = new TreeSet<>();
            }

            int exprOn = SECOND;

            StringTokenizer exprsTok = new StringTokenizer(expression, " \t", false);

            while (exprsTok.hasMoreTokens() && exprOn <= YEAR) {
                String expr = exprsTok.nextToken().trim();

                // throw an exception if L is used with other days of the month
                if (exprOn == DAY_OF_MONTH && expr.indexOf('L') != -1 && expr.length() > 1 && expr.contains(",")) {
                    throw new ParseException(
                            "Support for specifying 'L' and 'LW' with other days of the month is not implemented", -1);
                }
                // throw an exception if L is used with other days of the week
                if (exprOn == DAY_OF_WEEK && expr.indexOf('L') != -1 && expr.length() > 1 && expr.contains(",")) {
                    throw new ParseException(
                            "Support for specifying 'L' with other days of the week is not implemented", -1);
                }
                if (exprOn == DAY_OF_WEEK && expr.indexOf('#') != -1
                        && expr.indexOf('#', expr.indexOf('#') + 1) != -1) {
                    throw new ParseException("Support for specifying multiple \"nth\" days is not implemented.", -1);
                }

                StringTokenizer vTok = new StringTokenizer(expr, ",");
                while (vTok.hasMoreTokens()) {
                    String v = vTok.nextToken();
                    storeExpressionVals(0, v, exprOn);
                }

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Remove the comma list; use 'L' alone for last day of month, or a plain list without 'L'
  2. Use 'L-3' style offsets (without commas) if you need days before the last day
  3. Split into two separate schedules (two timer definitions) if both 'L' and explicit days are truly required

Example fix

// before
String cron = "0 0 12 L,15 * ?"; // unsupported
// after
String cron = "0 0 12 L * ?"; // or "0 0 12 15 * ?" or a second timer for the other day
Defensive patterns

Strategy: validation

Validate before calling

String dom = fields[2]; // after splitting on whitespace
if (dom.indexOf('L') != -1 && dom.contains(",")) throw new IllegalArgumentException("L cannot be combined in a day-of-month list");

Try / catch

try { new CronExpression(expr, clockReader); }
catch (ParseException e) { if (e.getMessage().contains("'L' and 'LW'")) { /* fix day-of-month field */ } throw e; }

Prevention

When it happens

Trigger: new CronExpression(expr, clockReader) or deserialization (readObject) where the 3rd field (day-of-month) contains 'L' together with a comma, such as '0 0 12 L,15 * ?'.

Common situations: Users assuming Quartz supports lists that include 'L'; migrating expressions between cron dialects (Spring/unix-style to Quartz-style); copy-paste of unsupported expressions from forum answers.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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