{"record":{"id":"89b012ead2c5742d","repo":"quarkusio/quarkus","slug":"value-not-set-for-param","errorCode":null,"errorMessage":"Value not set for ${param}","messagePattern":"Value not set for (.+?)","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java","lineNumber":962,"sourceCode":"                    constructorParamsHandles[iterator.previousIndex()] = loadObjectInstance(explicitValue, existing,\n                            explicitValue.getClass(), relaxedValidation);\n                } else {\n                    AnnotationValue value = annotationValues.get(valueMethod.name());\n                    if (value == null) {\n                        // method.invokeInterfaceMethod(MAP_PUT, valuesHandle, method.load(entry.getKey()), loadObjectInstance(method, entry.getValue(),\n                        // returnValueResults, entry.getValue().getClass()));\n                        Object defaultValue = annotationProxy.getDefaultValues().get(valueMethod.name());\n                        if (defaultValue != null) {\n                            constructorParamsHandles[iterator.previousIndex()] = loadObjectInstance(defaultValue, existing,\n                                    defaultValue.getClass(), relaxedValidation);\n                            continue;\n                        }\n                        if (value == null) {\n                            value = valueMethod.defaultValue();\n                        }\n                    }\n                    if (value == null) {\n                        throw new NullPointerException(\"Value not set for \" + param);\n                    }\n                    DeferredParameter retValue = loadValue(value, annotationProxy.getAnnotationClass(), valueMethod);\n                    constructorParamsHandles[iterator.previousIndex()] = retValue;\n                }\n            }\n            return new DeferredArrayStoreParameter(annotationProxy.getAnnotationLiteralType()) {\n                @Override\n                ResultHandle createValue(MethodContext context, MethodCreator method, ResultHandle array) {\n                    MethodDescriptor constructor = MethodDescriptor.ofConstructor(annotationProxy.getAnnotationLiteralType(),\n                            constructorParams.stream().map(m -> m.returnType().name().toString()).toArray());\n                    ResultHandle[] args = new ResultHandle[constructorParamsHandles.length];\n                    for (int i = 0; i < constructorParamsHandles.length; i++) {\n                        DeferredParameter deferredParameter = constructorParamsHandles[i];\n                        if (deferredParameter instanceof DeferredArrayStoreParameter) {\n                            DeferredArrayStoreParameter arrayParam = (DeferredArrayStoreParameter) deferredParameter;\n                            arrayParam.doPrepare(context);\n                        }\n                        args[i] = context.loadDeferred(deferredParameter);","sourceCodeStart":944,"sourceCodeEnd":980,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java#L944-L980","documentation":"When recording an annotation proxy (an @AnnotationProxyBuilder-generated literal for a recorder method taking an annotation type), Quarkus reads each annotation member via its accessor. If a member has no value set (including from its default) it throws this NullPointerException, because the generated annotation literal would have an undefined member.","triggerScenarios":"Creating an annotation proxy with AnnotationProxyBuilder for an annotation whose member method was never configured, and the annotation's member has no defaultValue() — then passing that proxy into a recorder method.","commonSituations":"Extension build steps synthesizing annotation instances to register classes (e.g. @Named, custom qualifiers) but forgetting to set a required member; annotation definitions changed upstream to add a member without a default; typos in member setter names.","solutions":["Call the setter for the missing member on the AnnotationProxyBuilder before passing it to the recorder — the message names the unset member","Provide a default value in the annotation definition so unset members are tolerated","Check the annotation class for newly added members after an upgrade and set them","Verify you are invoking the correct value method name matching the annotation member"],"exampleFix":"// before\nAnnotationProxyBuilder<MyAnno> b = new AnnotationProxyBuilder<>(MyAnno.class);\n// 'value' never set, no default in @MyAnno\nrecorder.register(b.built());\n// after\nAnnotationProxyBuilder<MyAnno> b = new AnnotationProxyBuilder<>(MyAnno.class);\nb.withValue(\"default\");\nrecorder.register(b.built());","handlingStrategy":"validation","validationCode":"// before passing an annotation proxy to a recorder\nfor (Method m : annotationType.getDeclaredMethods()) {\n    Object v = builder.getValue(m.getName());\n    if (v == null && m.getDefaultValue() == null) {\n        throw new IllegalStateException(\"Annotation member not set and has no default: \" + m.getName());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    recorder.register(proxyBuilder.built());\n} catch (NullPointerException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Value not set for\")) {\n        throw new IllegalStateException(\"Set all annotation members without defaults: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Set every annotation member lacking a default before building the proxy","Diff annotation definitions after upgrades for new members","Mirror member names exactly when calling builder setters"],"tags":["quarkus","annotations","annotation-proxy","build-time"],"backgroundTag":"missing-annotation-member-value","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"}