{"record":{"id":"64e473b9012bebc7","repo":"flowable/flowable-engine","slug":"job-jobid-failed","errorCode":null,"errorMessage":"Job {jobId} failed","messagePattern":"Job (.+?) failed","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnManagementServiceImpl.java","lineNumber":118,"sourceCode":"\n    @Override\n    public Collection<String> getTableNames() {\n        return commandExecutor.execute(new GetTableNamesCmd());\n    }\n    \n    @Override\n    public void executeJob(String jobId) {\n        if (jobId == null) {\n            throw new FlowableIllegalArgumentException(\"Job id is null\");\n        }\n\n        try {\n            commandExecutor.execute(new ExecuteJobCmd(jobId, configuration.getJobServiceConfiguration()));\n        } catch (RuntimeException e) {\n            if (e instanceof FlowableException) {\n                throw e;\n            } else {\n                throw new FlowableException(\"Job \" + jobId + \" failed\", e);\n            }\n        }\n    }\n    \n    @Override\n    public void executeHistoryJob(String historyJobId) {\n        commandExecutor.execute(new ExecuteHistoryJobCmd(historyJobId, configuration.getJobServiceConfiguration()));\n    }\n\n    @Override\n    public String getHistoryJobHistoryJson(String historyJobId) {\n        return commandExecutor.execute(new GetHistoryJobAdvancedConfigurationCmd(historyJobId, configuration.getJobServiceConfiguration()));\n    }\n\n    @Override\n    public void deleteHistoryJob(String jobId) {\n        commandExecutor.execute(new DeleteHistoryJobCmd(jobId, configuration.getJobServiceConfiguration()));\n    }","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnManagementServiceImpl.java#L100-L136","documentation":"Wrapper error thrown by CmmnManagementServiceImpl.executeJob when executing ExecuteJobCmd throws a RuntimeException that is NOT a FlowableException. Flowable rethrows its own exceptions as-is but wraps unexpected ones (NPE, ClassCastException, etc.) into a generic FlowableException with cause preserved.","triggerScenarios":"executeJob(jobId) where the job execution fails with a non-Flowable RuntimeException — e.g. NullPointerException inside a job handler, a scripting/serialization bug, or classpath issues in the job's delegate code.","commonSituations":"Buggy service task/delegate code throwing NPE; incompatible serialized variable payloads after an upgrade; missing class in the runtime classpath when the job handler loads it.","solutions":["Inspect the cause via e.getCause() — the real bug is in the wrapped exception's stack trace","Fix the underlying job handler/delegate that threw the runtime exception","Verify serialized job data compatibility after Flowable upgrades","Catch FlowableException at the caller and log cause chain for diagnosis"],"exampleFix":"// before\n} catch (RuntimeException e) {\n    log.error(\"job failed\", e); // message says 'Job x failed' with no detail\n}\n// after\n} catch (FlowableException e) {\n    Throwable cause = e.getCause();\n    log.error(\"root cause of job failure\", cause);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { managementService.executeJob(jobId); } catch (FlowableException e) { Throwable root = e.getCause(); if (root != null) log.error(\"job {} root cause\", jobId, root); }","preventionTips":["Always inspect getCause() — the message is generic, the cause is the real error","Test job delegates/handlers for null-safety","Keep serialized job variable data compatible across upgrades"],"tags":["java","job","wrapper-exception"],"backgroundTag":"api-error-response","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}