{"record":{"id":"4b3ee8460b0b4a09","repo":"quarkusio/quarkus","slug":"parameter-parametername-of-method-targetme-4b3ee8","errorCode":null,"errorMessage":"Parameter '${parameterName}' of method '${targetMethod.name()} of class '${declaringClassName}' is not allowed","messagePattern":"Parameter '(.+?)' of method '(.+?) of class '(.+?)' is not allowed","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/CustomFilterGenerator.java","lineNumber":362,"sourceCode":"                        \"getHttpHeaders\",\n                        HttpHeadersImpl.class);\n            } else if (REQUEST.equals(paramDotName)) {\n                GeneratorUtils.paramHandleFromReqContextMethod(filterMethod, rrReqCtxHandle, targetMethodParamHandles,\n                        i,\n                        \"getRequest\",\n                        REQUEST);\n            } else if (RESOURCE_INFO.equals(paramDotName)) {\n                targetMethodParamHandles[i] = getResourceInfoHandle(filterMethod, rrReqCtxHandle);\n            } else if (ResteasyReactiveServerDotNames.SIMPLIFIED_RESOURCE_INFO.equals(paramDotName)) {\n                targetMethodParamHandles[i] = getSimpleResourceInfoHandle(filterMethod, rrReqCtxHandle);\n            } else if (ResteasyReactiveDotNames.CONTINUATION.equals(paramDotName)) {\n                // the continuation to pass on to the target is retrieved from the last parameter of the filter method\n                targetMethodParamHandles[i] = filterMethod.getMethodParam(filterMethodParamCount - 1);\n            } else if (unwrappableTypes.contains(paramDotName)) {\n                targetMethodParamHandles[i] = GeneratorUtils.unwrapObject(filterMethod, rrReqCtxHandle, paramDotName);\n            } else {\n                String parameterName = targetMethod.parameterName(i);\n                throw new RuntimeException(\"Parameter '\" + parameterName + \"' of method '\" + targetMethod.name()\n                        + \" of class '\" + declaringClassName\n                        + \"' is not allowed\");\n            }\n        }\n        return targetMethodParamHandles;\n    }\n\n    String generateContainerResponseFilter(MethodInfo targetMethod, ClassOutput classOutput) {\n        checkModifiers(targetMethod, ResteasyReactiveServerDotNames.SERVER_RESPONSE_FILTER);\n        if (KotlinUtils.isSuspendMethod(targetMethod)) {\n            return generateResponseFilterForSuspendedMethod(targetMethod, classOutput, isOptionalFilter.test(targetMethod));\n        }\n        return generateStandardContainerResponseFilter(targetMethod, classOutput, isOptionalFilter.test(targetMethod));\n    }\n\n    private String generateResponseFilterForSuspendedMethod(MethodInfo targetMethod, ClassOutput classOutput,\n            boolean checkForOptionalBean) {\n        DotName returnDotName = determineReturnDotNameOfSuspendMethod(targetMethod);","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/CustomFilterGenerator.java#L344-L380","documentation":"getRequestFilterResultHandles maps each parameter of a @ServerRequestFilter method to generated bytecode handles. Only supported parameter types are allowed: the ContainerRequestContext itself, unwrappable types (e.g. UriInfo, HttpHeaders, SecurityContext, request bodies via registered providers), and Continuation for Kotlin suspend methods. Any other parameter type throws this RuntimeException and fails the build.","triggerScenarios":"Declaring a @ServerRequestFilter method with a parameter whose type is not an injectable/filter-supported type — e.g. a custom POJO, ServletRequest, or an unregistered body type.","commonSituations":"Adding convenience parameters to filters expecting CDI-style injection, porting filters from other frameworks, or forgetting @Context/@Param-style qualifiers where required.","solutions":["Remove or replace the unsupported parameter with a supported one (ContainerRequestContext, UriInfo, HttpHeaders, SecurityContext, etc.)","If you need a bean, inject it into the declaring class (field/constructor) instead of the filter method","Retrieve needed data from the ContainerRequestContext inside the filter body","Ensure body-type parameters are supported by the configured message body readers"],"exampleFix":"// before\n@ServerRequestFilter\npublic void filter(ContainerRequestContext ctx, MyService svc) { ... }\n\n// after\n@ServerRequestFilter\npublic void filter(ContainerRequestContext ctx) {\n    MyService svc = Arc.container().instance(MyService.class).get();\n}","handlingStrategy":"validation","validationCode":"private static final Set<Class<?>> ALLOWED = Set.of(ContainerRequestContext.class, UriInfo.class,\n    HttpHeaders.class, SecurityContext.class, HttpHost.class);\nfor (Class<?> p : filterMethod.getParameterTypes()) {\n    if (!ALLOWED.contains(p) && !isUnwrappable(p) && p != Continuation.class) {\n        throw new IllegalStateException(\"Unsupported request filter parameter: \" + p);\n    }\n}\n","typeGuard":"static boolean isSupportedRequestFilterParam(Class<?> p) {\n    return ContainerRequestContext.class.isAssignableFrom(p)\n        || UriInfo.class.equals(p) || HttpHeaders.class.equals(p) || SecurityContext.class.equals(p)\n        || Continuation.class.equals(p);\n}\n","tryCatchPattern":null,"preventionTips":["Only use documented @ServerRequestFilter parameter types","Inject CDI beans into the declaring class, not the filter method","Derive extra data from ContainerRequestContext inside the method body","Check the Quarkus filter docs table of allowed parameters before adding one"],"tags":["quarkus","resteasy-reactive","filter","parameters","build-time"],"backgroundTag":"unsupported-filter-parameter","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"}