{"record":{"id":"6af17bfc57281c92","repo":"quarkusio/quarkus","slug":"jax-rs-application-class-applicationclassinfo-n","errorCode":null,"errorMessage":"JAX-RS Application class '${applicationClassInfo.name()}' contains multiple conflicting @Blocking, @NonBlocking and @RunOnVirtualThread annotations.","messagePattern":"JAX-RS Application class '(.+?)' contains multiple conflicting @Blocking, @NonBlocking and @RunOnVirtualThread annotations\\.","errorType":"exception","errorClass":"DeploymentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java","lineNumber":137,"sourceCode":"                    | InvocationTargetException e) {\n                throw new RuntimeException(\"Unable to handle class: \" + applicationClass, e);\n            }\n            // collect default behaviour, making sure that we don't have multiple contradicting annotations\n            int numAnnotations = 0;\n            if (applicationClassInfo.hasDeclaredAnnotation(ResteasyReactiveDotNames.BLOCKING)) {\n                blocking = BlockingDefault.BLOCKING;\n                numAnnotations++;\n            }\n            if (applicationClassInfo.hasDeclaredAnnotation(ResteasyReactiveDotNames.NON_BLOCKING)) {\n                blocking = BlockingDefault.NON_BLOCKING;\n                numAnnotations++;\n            }\n            if (applicationClassInfo.hasDeclaredAnnotation(ResteasyReactiveDotNames.RUN_ON_VIRTUAL_THREAD)) {\n                blocking = BlockingDefault.RUN_ON_VIRTUAL_THREAD;\n                numAnnotations++;\n            }\n            if (numAnnotations > 1) {\n                throw new DeploymentException(\"JAX-RS Application class '\" + applicationClassInfo.name()\n                        + \"' contains multiple conflicting @Blocking, @NonBlocking and @RunOnVirtualThread annotations.\");\n            }\n        }\n        if (selectedAppClass != null) {\n            globalNameBindings = NameBindingUtil.nameBindingNames(index, selectedAppClass);\n        }\n        return new ApplicationScanningResult(allowedClasses, singletonClasses, excludedClasses, globalNameBindings,\n                filterClasses, application,\n                selectedAppClass, blocking);\n    }\n\n    public static SerializerScanningResult scanForSerializers(IndexView index,\n            ApplicationScanningResult applicationScanningResult) {\n\n        Collection<ClassInfo> readers = index\n                .getAllKnownImplementors(ResteasyReactiveDotNames.MESSAGE_BODY_READER);\n        List<ScannedSerializer> readerList = new ArrayList<>();\n","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java#L119-L155","documentation":"The JAX-RS Application class declares more than one of @Blocking, @NonBlocking, or @RunOnVirtualThread at the class level. These annotations all define the default execution model for the application, so only one may be present; declaring several is contradictory.","triggerScenarios":"scanForApplicationClass counts declared annotations among BLOCKING, NON_BLOCKING, RUN_ON_VIRTUAL_THREAD on the Application class; if numAnnotations > 1 it throws this DeploymentException.","commonSituations":"Adding @RunOnVirtualThread to an Application that already had @Blocking (or @NonBlocking) while migrating to virtual threads; copy-pasting annotation blocks between Application classes.","solutions":["Keep exactly one of @Blocking, @NonBlocking, or @RunOnVirtualThread on the Application class.","Set the execution model per-resource-method instead of at the Application level when mixing models is intended.","Configure the default execution model via quarkus.resteasy-reactive.* config properties rather than annotations."],"exampleFix":"// before\n@Blocking\n@RunOnVirtualThread\nclass MyApp extends Application { }\n// after\n@RunOnVirtualThread\nclass MyApp extends Application { }","handlingStrategy":"validation","validationCode":"long n = java.util.Arrays.stream(appClass.getAnnotations())\n        .map(a -> a.annotationType().getSimpleName())\n        .filter(nm -> nm.equals(\"Blocking\") || nm.equals(\"NonBlocking\") || nm.equals(\"RunOnVirtualThread\"))\n        .count();\nif (n > 1) throw new IllegalStateException(\"Only one execution-model annotation allowed on \" + appClass);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Apply at most one of @Blocking/@NonBlocking/@RunOnVirtualThread per class","Prefer per-method annotations when mixing execution models","Set the default model via quarkus.resteasy-reactive.* config instead"],"tags":["jaxrs","annotations","execution-model","build-time"],"backgroundTag":"conflicting-execution-model-annotations","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}