{"record":{"id":"5b5f2e57a4bb7d7c","repo":"flowable/flowable-engine","slug":"support-for-specifying-l-and-lw-with-other-day","errorCode":null,"errorMessage":"Support for specifying 'L' and 'LW' with other days of the month is not implemented","messagePattern":"Support for specifying 'L' and 'LW' with other days of the month is not implemented","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java","lineNumber":493,"sourceCode":"                months = new TreeSet<>();\n            }\n            if (daysOfWeek == null) {\n                daysOfWeek = new TreeSet<>();\n            }\n            if (years == null) {\n                years = new TreeSet<>();\n            }\n\n            int exprOn = SECOND;\n\n            StringTokenizer exprsTok = new StringTokenizer(expression, \" \\t\", false);\n\n            while (exprsTok.hasMoreTokens() && exprOn <= YEAR) {\n                String expr = exprsTok.nextToken().trim();\n\n                // throw an exception if L is used with other days of the month\n                if (exprOn == DAY_OF_MONTH && expr.indexOf('L') != -1 && expr.length() > 1 && expr.contains(\",\")) {\n                    throw new ParseException(\n                            \"Support for specifying 'L' and 'LW' with other days of the month is not implemented\", -1);\n                }\n                // throw an exception if L is used with other days of the week\n                if (exprOn == DAY_OF_WEEK && expr.indexOf('L') != -1 && expr.length() > 1 && expr.contains(\",\")) {\n                    throw new ParseException(\n                            \"Support for specifying 'L' with other days of the week is not implemented\", -1);\n                }\n                if (exprOn == DAY_OF_WEEK && expr.indexOf('#') != -1\n                        && expr.indexOf('#', expr.indexOf('#') + 1) != -1) {\n                    throw new ParseException(\"Support for specifying multiple \\\"nth\\\" days is not implemented.\", -1);\n                }\n\n                StringTokenizer vTok = new StringTokenizer(expr, \",\");\n                while (vTok.hasMoreTokens()) {\n                    String v = vTok.nextToken();\n                    storeExpressionVals(0, v, exprOn);\n                }\n","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java#L475-L511","documentation":"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.","triggerScenarios":"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 * ?'.","commonSituations":"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.","solutions":["Remove the comma list; use 'L' alone for last day of month, or a plain list without 'L'","Use 'L-3' style offsets (without commas) if you need days before the last day","Split into two separate schedules (two timer definitions) if both 'L' and explicit days are truly required"],"exampleFix":"// before\nString cron = \"0 0 12 L,15 * ?\"; // unsupported\n// after\nString cron = \"0 0 12 L * ?\"; // or \"0 0 12 15 * ?\" or a second timer for the other day","handlingStrategy":"validation","validationCode":"String dom = fields[2]; // after splitting on whitespace\nif (dom.indexOf('L') != -1 && dom.contains(\",\")) throw new IllegalArgumentException(\"L cannot be combined in a day-of-month list\");","typeGuard":null,"tryCatchPattern":"try { new CronExpression(expr, clockReader); }\ncatch (ParseException e) { if (e.getMessage().contains(\"'L' and 'LW'\")) { /* fix day-of-month field */ } throw e; }","preventionTips":["Never put 'L' or 'LW' inside a comma list in day-of-month","Use 'L-n' offsets instead of listing days near month end","Split complex schedules into multiple timers"],"tags":["cron","unsupported-feature","flowable","quartz"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}