{"record":{"id":"5a495d31e4c54bc3","repo":"quarkusio/quarkus","slug":"unable-to-inject-s-callback-parameter-s-decla","errorCode":null,"errorMessage":"Unable to inject @%s callback parameter '%s' declared on %s: no injector found","messagePattern":"Unable to inject @(.+?) callback parameter '(.+?)' declared on (.+?): no injector found","errorType":"exception","errorClass":"WebSocketException","httpStatus":null,"severity":"error","filePath":"extensions/websockets-next/deployment/src/main/java/io/quarkus/websockets/next/deployment/Callback.java","lineNumber":210,"sourceCode":"    }\n\n    private List<CallbackArgument> collectArguments(AnnotationInstance annotation, MethodInfo method,\n            CallbackArgumentsBuildItem callbackArguments, TransformedAnnotationsBuildItem transformedAnnotations,\n            IndexView index) {\n        List<MethodParameterInfo> parameters = method.parameters();\n        if (parameters.isEmpty()) {\n            return List.of();\n        }\n        List<CallbackArgument> arguments = new ArrayList<>(parameters.size());\n        for (MethodParameterInfo parameter : parameters) {\n            List<CallbackArgument> found = callbackArguments\n                    .findMatching(parameterContext(annotation, parameter, transformedAnnotations, index));\n            if (found.isEmpty()) {\n                String msg = String.format(\"Unable to inject @%s callback parameter '%s' declared on %s: no injector found\",\n                        DotNames.simpleName(annotation.name()),\n                        parameter.name() != null ? parameter.name() : \"#\" + parameter.position(),\n                        asString());\n                throw new WebSocketException(msg);\n            } else if (found.size() > 1 && (found.get(0).priority() == found.get(1).priority())) {\n                String msg = String.format(\n                        \"Unable to inject @%s callback parameter '%s' declared on %s: ambiguous injectors found: %s\",\n                        DotNames.simpleName(annotation.name()),\n                        parameter.name() != null ? parameter.name() : \"#\" + parameter.position(),\n                        asString(),\n                        found.stream().map(p -> p.getClass().getSimpleName() + \":\" + p.priority()));\n                throw new WebSocketException(msg);\n            }\n            arguments.add(found.get(0));\n        }\n        return List.copyOf(arguments);\n    }\n\n    Type argumentType(Predicate<CallbackArgument> filter) {\n        for (int i = 0; i < arguments.size(); i++) {\n            if (filter.test(arguments.get(i))) {\n                return method.parameterType(i);","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/deployment/src/main/java/io/quarkus/websockets/next/deployment/Callback.java#L192-L228","documentation":"At build time websockets-next resolves each parameter of an @WebSocket/@WebSocketClient callback (onOpen/onMessage/onClose/onError) by matching it against registered ParameterConverters (injectors). When no parameter injector matches the annotation and type of a parameter, the build fails with WebSocketException. This catches unsupported callback parameter types/annotations early.","triggerScenarios":"Declaring a callback method parameter annotated with a supported injection annotation (e.g. @PathParam, @HeaderParam, @Message) but with a type for which no injector is registered, or using an annotation no ParameterConverter handles.","commonSituations":"Typos or custom annotations on callback parameters; unsupported parameter types (e.g. custom classes where only String/byte[]/specific types are supported); using an annotation in a context where its injector is not registered (e.g. on the wrong callback kind).","solutions":["Change the parameter to a supported type for that annotation (e.g. String for @PathParam)","Remove the annotation if the parameter does not need injection and use a supported type (WebSocketConnection, Incoming/Message, etc.)","Check the websockets-next documentation for the list of supported callback parameter kinds and their annotations","Upgrade the extension version — new parameter injectors are added over time"],"exampleFix":"// before\n@OnMessage\nvoid onMessage(@PathParam(\"id\") UUID id, String msg) { }\n// after\n@OnMessage\nvoid onMessage(@PathParam(\"id\") String id, String msg) { }","handlingStrategy":"validation","validationCode":"// Before the build, check each callback param annotation+type pair\n// against the supported table (String for @PathParam, WebSocketConnection, etc.)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use parameter types listed in the websockets-next docs","Do not invent custom annotations for callback injection","Keep the extension updated for newly supported parameter kinds"],"tags":["quarkus","websockets-next","build-time","dependency-injection"],"backgroundTag":"websocket-callback-parameter-unsupported","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"}