{"record":{"id":"bbffec3781dc8b8e","repo":"quarkusio/quarkus","slug":"no-parameter-of-type-beaninfo-or-observerinfo-for","errorCode":null,"errorMessage":"No parameter of type BeanInfo or ObserverInfo for method \" + method","messagePattern":"No parameter of type BeanInfo or ObserverInfo for method \" \\+ method","errorType":"exception","errorClass":"DefinitionException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/bcextensions/ExtensionPhaseRegistration.java","lineNumber":52,"sourceCode":"        this.assignability = new io.quarkus.arc.processor.AssignabilityCheck(beanArchiveIndex, null);\n    }\n\n    void runExtensionMethod(ExtensionMethod method) throws ReflectiveOperationException {\n        int numQueryParameters = 0;\n        List<ExtensionMethodParameter> parameters = new ArrayList<>(method.parametersCount());\n        for (org.jboss.jandex.Type parameterType : method.parameterTypes()) {\n            ExtensionMethodParameter parameter = ExtensionMethodParameter.of(parameterType);\n            parameters.add(parameter);\n\n            if (parameter.isQuery()) {\n                numQueryParameters++;\n            }\n\n            parameter.verifyAvailable(ExtensionPhase.REGISTRATION, method);\n        }\n\n        if (numQueryParameters == 0) {\n            throw new DefinitionException(\"No parameter of type BeanInfo or ObserverInfo for method \" + method);\n        }\n\n        if (numQueryParameters > 1) {\n            throw new DefinitionException(\"More than 1 parameter of type BeanInfo or ObserverInfo for method \" + method);\n        }\n\n        ExtensionMethodParameter query = parameters.stream()\n                .filter(ExtensionMethodParameter::isQuery)\n                .findAny()\n                .get(); // guaranteed to be there\n\n        List<?> allValuesForQueryParameter = Collections.emptyList();\n        if (query == ExtensionMethodParameter.BEAN_INFO) {\n            allValuesForQueryParameter = matchingBeans(method.jandex, false);\n        } else if (query == ExtensionMethodParameter.INTERCEPTOR_INFO) {\n            allValuesForQueryParameter = matchingBeans(method.jandex, true);\n        } else if (query == ExtensionMethodParameter.OBSERVER_INFO) {\n            allValuesForQueryParameter = matchingObservers(method.jandex);","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/bcextensions/ExtensionPhaseRegistration.java#L34-L70","documentation":"A build-time @Registration extension method must declare exactly one query parameter of type BeanInfo or ObserverInfo, which identifies the bean or observer being registered. ExtensionPhaseRegistration.runExtensionMethod() throws DefinitionException when no such parameter exists, because the registration callback has nothing to register against.","triggerScenarios":"Annotating a method with @Registration whose parameters contain neither BeanInfo nor ObserverInfo (e.g. only context/config types or no parameters at all), so numQueryParameters == 0 at processing time.","commonSituations":"Writing a registration callback that only captures the RegistrationContext and forgetting the BeanInfo/ObserverInfo argument; converting a method from another phase where BeanInfo is invalid and dropping it; typos importing a similarly named type.","solutions":["Add a BeanInfo parameter (for bean registration) or ObserverInfo parameter (for observer registration) to the @Registration method.","Remove the @Registration annotation if the method is not meant to register beans/observers.","Confirm the parameter type is Arc's BeanInfo/ObserverInfo (io.quarkus.arc.processor) and not a same-named class from another dependency."],"exampleFix":"// before\n@Registration\nvoid register(RegistrationContext ctx) { ... }\n\n// after\n@Registration\nvoid register(BeanInfo bean, RegistrationContext ctx) { ... }","handlingStrategy":"validation","validationCode":"boolean hasTarget = Arrays.stream(method.getParameters())\n    .map(p -> p.type().name().withoutPackagePrefix())\n    .anyMatch(n -> n.equals(\"BeanInfo\") || n.equals(\"ObserverInfo\"));\nif (!hasTarget) throw new IllegalStateException(\"@Registration method needs BeanInfo or ObserverInfo parameter\");","typeGuard":"static boolean hasRegistrationTarget(MethodInfo m) {\n    return Arrays.stream(m.parameters()).anyMatch(p ->\n        p.type().name().withoutPackagePrefix().equals(\"BeanInfo\")\n        || p.type().name().withoutPackagePrefix().equals(\"ObserverInfo\"));\n}","tryCatchPattern":"try {\n    processor.run(extensionClass);\n} catch (DefinitionException e) {\n    fail(\"@Registration method missing BeanInfo/ObserverInfo: \" + e.getMessage());\n}","preventionTips":["Start every @Registration method with a BeanInfo or ObserverInfo parameter.","Import Arc's io.quarkus.arc.processor.BeanInfo/ObserverInfo, not same-named classes from other libraries.","Never annotate non-registration helpers with @Registration."],"tags":["arc","cdi","build-time-extension","quarkus"],"backgroundTag":"missing-extension-query-parameter","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"}