{"record":{"id":"a2cb9cbffdd59e60","repo":"flowable/flowable-engine","slug":"transactioncallback-threw-undeclared-checked-excep","errorCode":null,"errorMessage":"TransactionCallback threw undeclared checked exception","messagePattern":"TransactionCallback threw undeclared checked exception","errorType":"exception","errorClass":"UndeclaredThrowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/interceptor/JtaTransactionInterceptor.java","lineNumber":72,"sourceCode":"        Transaction oldTx = null;\n        try {\n            boolean existing = isExisting();\n            boolean isNew = !existing || requiresNew;\n            if (existing && requiresNew) {\n                oldTx = doSuspend();\n            }\n            if (isNew) {\n                doBegin();\n            }\n            T result;\n            try {\n                result = next.execute(config, command, commandExecutor);\n            } catch (RuntimeException | Error ex) {\n                doRollback(isNew, ex);\n                throw ex;\n            } catch (Exception ex) {\n                doRollback(isNew, ex);\n                throw new UndeclaredThrowableException(ex, \"TransactionCallback threw undeclared checked exception\");\n            }\n            if (isNew) {\n                doCommit();\n            }\n            return result;\n        } finally {\n            doResume(oldTx);\n        }\n    }\n\n    private void doBegin() {\n        try {\n            transactionManager.begin();\n        } catch (NotSupportedException | SystemException e) {\n            throw new TransactionException(\"Unable to begin transaction\", e);\n        }\n    }\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/interceptor/JtaTransactionInterceptor.java#L54-L90","documentation":"Wrapper thrown by JtaTransactionInterceptor.execute: the wrapped command/callback threw a checked exception not declared by the callable signature; it is wrapped in UndeclaredThrowableException so it can propagate through the interceptor chain.","triggerScenarios":"Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/interceptor/JtaTransactionInterceptor.java:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the cause to find the undeclared checked exception","Wrap checked exceptions in FlowableException inside custom commands"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}