{"record":{"id":"86ad0ef8354d6f4f","repo":"quarkusio/quarkus","slug":"exceptionmsgsupplier-get-blocking-annotation","errorCode":null,"errorMessage":"${exceptionMsgSupplier.get()} (blocking annotations conflict)","messagePattern":"(.+?) \\(blocking annotations conflict\\)","errorType":"exception","errorClass":"DeploymentException","httpStatus":null,"severity":"error","filePath":"extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java","lineNumber":498,"sourceCode":"        VIRTUAL_THREAD(true),\n        NON_BLOCKING(false),\n        // @Transactional on a method\n        IMPLICIT(true);\n\n        final boolean blocking;\n\n        BlockingMode(boolean blocking) {\n            this.blocking = blocking;\n        }\n    }\n\n    private static BlockingMode nonInheritedBlockingMode(Predicate<DotName> checker,\n            Supplier<String> exceptionMsgSupplier) {\n        boolean blocking = checker.test(BLOCKING);\n        boolean nonBlocking = checker.test(NON_BLOCKING);\n        boolean vt = checker.test(RUN_ON_VIRTUAL_THREAD);\n        if (blocking && nonBlocking) {\n            throw new DeploymentException(exceptionMsgSupplier.get());\n        }\n        if (nonBlocking && vt) {\n            throw new DeploymentException(exceptionMsgSupplier.get());\n        }\n        if (blocking && !vt) {\n            return BlockingMode.BLOCKING;\n        }\n        if (vt) {\n            return BlockingMode.VIRTUAL_THREAD;\n        }\n        if (nonBlocking) {\n            return BlockingMode.NON_BLOCKING;\n        }\n        boolean transactional = checker.test(TRANSACTIONAL);\n        if (transactional) { // Cannot be on a virtual thread here.\n            return BlockingMode.IMPLICIT;\n        }\n        return BlockingMode.UNDEFINED;","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java#L480-L516","documentation":"A gRPC method declares both @Blocking and @NonBlocking (annotation conflict detected in nonInheritedBlockingMode). Quarkus cannot decide the execution model, so the build fails. The same message format is used for any blocking-annotations conflict supplied by the caller.","triggerScenarios":"@Blocking and @NonBlocking are both present on the same gRPC service method (via method, class, or interface inheritance through the checker predicate).","commonSituations":"Copy-pasting blocking style annotations while also adding @NonBlocking; class-level @Blocking combined with a method-level @NonBlocking intent written as both; merging branches that each added a different annotation.","solutions":["Keep only one of @Blocking/@NonBlocking on the method (or its class)","Use @NonBlocking with @RunOnVirtualThread only if that is intended (see related error)","Check inherited annotations from implemented service interfaces for the conflicting annotation"],"exampleFix":"// before\n@Blocking\n@NonBlocking\npublic void greet(...) { ... }\n\n// after\n@Blocking\npublic void greet(...) { ... }","handlingStrategy":"validation","validationCode":"// review annotations before build\nif (m.isAnnotationPresent(Blocking.class) && m.isAnnotationPresent(NonBlocking.class)) {\n    throw new IllegalStateException(\"Choose either @Blocking or @NonBlocking: \" + m);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one execution-model annotation per method","Audit inherited annotations from service interfaces","Document the project convention for blocking vs non-blocking methods"],"tags":["grpc","blocking","annotation-conflict"],"backgroundTag":"annotation-conflict","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"}