{"record":{"id":"e6f3df051d421083","repo":"quarkusio/quarkus","slug":"no-annotations-found-on-fields-at-s-annotation","errorCode":null,"errorMessage":"No annotations found on fields at '%s'. Annotations like `@QueryParam` should be used in fields, not in methods.","messagePattern":"No annotations found on fields at '(.+?)'\\. Annotations like `@QueryParam` should be used in fields, not in methods\\.","errorType":"validation","errorClass":"DeploymentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ServerEndpointIndexer.java","lineNumber":313,"sourceCode":"        return null;\n    }\n\n    @Override\n    protected boolean handleBeanParam(ClassInfo actualEndpointInfo, Type paramType, MethodParameter[] methodParameters, int i,\n            Set<String> fileFormNames) {\n        ClassInfo beanParamClassInfo = index.getClassByName(paramType.name());\n        InjectableBean injectableBean = scanInjectableBean(beanParamClassInfo,\n                actualEndpointInfo,\n                existingConverters, additionalReaders, injectableBeans, hasRuntimeConverters);\n        if ((injectableBean.getFieldExtractorsCount() == 0) && !injectableBean.isInjectionRequired()) {\n            long declaredMethodsCount = beanParamClassInfo.methods().stream()\n                    .filter(m -> !m.name().equals(\"<init>\") && !m.name().equals(\"<clinit>\")).count();\n            if (declaredMethodsCount == 0) {\n                throw new DeploymentException(String.format(\n                        \"Class %s has no fields. Parameters containers are only supported if they have at least one annotated field.\",\n                        beanParamClassInfo.name()));\n            } else {\n                throw new DeploymentException(String.format(\"No annotations found on fields at '%s'. \"\n                        + \"Annotations like `@QueryParam` should be used in fields, not in methods.\",\n                        beanParamClassInfo.name()));\n            }\n\n        }\n        fileFormNames.addAll(injectableBean.getFileFormNames());\n        return injectableBean.isFormParamRequired();\n    }\n\n    @Override\n    protected boolean doesMethodHaveBlockingSignature(MethodInfo info) {\n        for (var i : methodScanners) {\n            if (i.isMethodSignatureAsync(info)) {\n                return false;\n            }\n        }\n        return true;\n    }","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ServerEndpointIndexer.java#L295-L331","documentation":"RESTEasy Reactive extracts request parameter values from annotated FIELDS of @BeanParam containers. If no field is annotated but the class has methods, it concludes the annotations (@QueryParam, @HeaderParam, etc.) were placed on methods and throws this DeploymentException.","triggerScenarios":"Declaring class MyParams { @QueryParam(\"q\") void setQ(String q) {...} } or putting @QueryParam on a getter, then using MyParams as a @BeanParam.","commonSituations":"Migrating from frameworks that bind via annotated setters; IDE-generated getters/setters receiving the annotations; assuming Spring-MVC-style property binding works here.","solutions":["Move the REST parameter annotations from methods onto the corresponding fields.","Use a record with annotated components for a compact immutable container.","Delete the method annotations if they were added by mistake."],"exampleFix":"// before\nclass Filters {\n    @QueryParam(\"sort\")\n    public void setSort(String sort) { this.sort = sort; }\n}\n\n// after\nclass Filters {\n    @QueryParam(\"sort\")\n    public String sort;\n}","handlingStrategy":"validation","validationCode":"boolean anyAnnotatedField = false;\nfor (java.lang.reflect.Field f : Filters.class.getDeclaredFields()) {\n    if (f.isAnnotationPresent(jakarta.ws.rs.QueryParam.class)) { anyAnnotatedField = true; break; }\n}\nif (!anyAnnotatedField) throw new IllegalStateException(\"@QueryParam must be on fields, not methods\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always annotate fields directly in @BeanParam classes.","Check annotation placement in code reviews.","Prefer records with annotated components for immutable containers."],"tags":["resteasy-reactive","quarkus","beanparam","queryparam","annotations","deployment-failure"],"backgroundTag":"bean-param-annotations-on-methods","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"}