{"record":{"id":"4be009cdeb3a7c1a","repo":"flowable/flowable-engine","slug":"provided-exception-message-is-null-4be009","errorCode":null,"errorMessage":"Provided exception message is null","messagePattern":"Provided exception message is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TimerJobQueryImpl.java","lineNumber":178,"sourceCode":"    @Override\n    public TimerJobQuery duedateLowerThenOrEquals(Date date) {\n        if (date == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided date is null\");\n        }\n        this.duedateLowerThanOrEqual = date;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery withException() {\n        this.withException = true;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery exceptionMessage(String exceptionMessage) {\n        if (exceptionMessage == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided exception message is null\");\n        }\n        this.exceptionMessage = exceptionMessage;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery jobTenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided tentant id is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery jobTenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided tentant id is null\");","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TimerJobQueryImpl.java#L160-L196","documentation":"TimerJobQuery.exceptionMessage(String) throws ActivitiIllegalArgumentException when the exception message argument is null. This filter finds timer jobs that failed with a specific exception text; a null value would be an empty/meaningless filter and is rejected up front.","triggerScenarios":"Calling timerJobQuery().exceptionMessage(null) — commonly because the failure's stack trace/message was never captured into the job (job not failed yet) and the retrieved message was null, then passed into the query.","commonSituations":"Dead-letter dashboards where the selected job has no stored exception message; retry tooling passing job.getExceptionMessage() straight back into a query without checking for null; matching on failures that were never persisted.","solutions":["Pass a non-null exception message string (use empty string or a wildcard if you need a broader match)","Only set the filter when job.getExceptionMessage() != null","Query failed jobs first (e.g. .failed()) instead of filtering by an unknown message"],"exampleFix":"// before\nquery.exceptionMessage(job.getExceptionMessage()); // null if job has no exception\n// after\nString msg = job.getExceptionMessage();\nif (msg != null) {\n    query.exceptionMessage(msg);\n}","handlingStrategy":"validation","validationCode":"String msg = job != null ? job.getExceptionMessage() : null;\nif (msg == null) {\n    throw new IllegalStateException(\"job has no stored exception message; filter by failed state instead\");\n}\nquery.exceptionMessage(msg);","typeGuard":"boolean hasExceptionMessage(Job job) { return job != null && job.getExceptionMessage() != null; }","tryCatchPattern":"try {\n    query.exceptionMessage(message);\n} catch (ActivitiIllegalArgumentException e) {\n    log.warn(\"No exception message available; falling back to failed-jobs query\");\n    query.failed();\n}","preventionTips":["Check job.getExceptionMessage() for null before using it as a filter","Use .failed() to find failed jobs instead of filtering by unknown message text","Never round-trip nullable job fields directly into query setters"],"tags":["flowable","activiti","null-argument","job-query"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}