{"record":{"id":"9c3ad824de221109","repo":"quarkusio/quarkus","slug":"cannot-find-a-transactional-annotation","errorCode":null,"errorMessage":"Cannot find a @Transactional annotation","messagePattern":"Cannot find a @Transactional annotation","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/reactive-transactions/runtime/src/main/java/io/quarkus/reactive/transaction/runtime/TransactionalInterceptorBase.java","lineNumber":336,"sourceCode":"    /**\n     * <p>\n     * Looking for the {@link Transactional} annotation first on the method,\n     * second on the class.\n     * <p>\n     * Method handles CDI types to cover cases where extensions are used. In\n     * case of EE container uses reflection.\n     *\n     * @param context invocation context of the interceptor\n     * @return instance of {@link Transactional} annotation or null\n     */\n    private Transactional getTransactionalAnnotation(InvocationContext context) {\n        Set<Annotation> bindings = InterceptorBindings.getInterceptorBindings(context);\n        for (Annotation binding : bindings) {\n            if (binding.annotationType() == Transactional.class) {\n                return (Transactional) binding;\n            }\n        }\n        throw new RuntimeException(\"Cannot find a @Transactional annotation\");\n    }\n}\n","sourceCodeStart":318,"sourceCodeEnd":339,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/reactive-transactions/runtime/src/main/java/io/quarkus/reactive/transaction/runtime/TransactionalInterceptorBase.java#L318-L339","documentation":"The interceptor searches the current interceptor bindings for a @Transactional annotation; if none is present the annotation lookup cannot proceed and it throws RuntimeException(\"Cannot find a @Transactional annotation\"). This indicates the interceptor was invoked without the expected binding, usually due to interception misconfiguration.","triggerScenarios":"Invoking the reactive transactional interceptor on a bean/method whose effective interceptor bindings lack @Transactional (e.g. binding metadata removed/overridden, interceptor bound globally but annotation lost via inheritance or custom interception factory).","commonSituations":"Custom interceptor binding wiring that strips @Transactional; ArC/CDI interception edge cases with generics or default methods; incorrect interceptor priority configuration shadowing the annotation.","solutions":["Ensure the invoked method (or its class) is actually annotated @Transactional and that annotation retention/inheritance is intact.","Check for custom InterceptorBinding/interceptor registrations that intercept the method without @Transactional and fix the binding.","Rebuild and clear incremental build state; if using interception factories, make sure @Transactional is included in the bindings passed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before invoking through a custom interception path\nTransactional tx = method.getAnnotation(Transactional.class);\nif (tx == null)\n    throw new IllegalStateException(\"Interceptor requires @Transactional on \" + method);","typeGuard":null,"tryCatchPattern":"try {\n    return service.op();\n} catch (RuntimeException e) {\n    if (\"Cannot find a @Transactional annotation\".equals(e.getMessage()))\n        log.error(\"Interception bindings lost; check CDI wiring for the target bean\");\n    throw e;\n}","preventionTips":["Don't strip/override @Transactional via custom interceptor bindings","Avoid invoking interceptors manually; rely on CDI-managed beans","Verify bindings when using InterceptionFactory","Rebuild cleanly after upgrading Quarkus to refresh ArC metadata"],"tags":["quarkus","cdi","interceptor","transactions"],"backgroundTag":"missing-transactional-annotation","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}