{"record":{"id":"930e29f63d91a5fc","repo":"quarkusio/quarkus","slug":"couldn-t-extract-all-parameters-information-for-co","errorCode":null,"errorMessage":"Couldn't extract all parameters information for constructor ${selectedCtor} for type ${expectedType}","messagePattern":"Couldn't extract all parameters information for constructor (.+?) for type (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java","lineNumber":1274,"sourceCode":"            Constructor<?> selectedCtor = null;\n            if (ctors.length == 1) {\n                // if there is a single constructor we use it regardless of the presence of @RecordableConstructor annotation\n                selectedCtor = ctors[0];\n            }\n            for (Constructor<?> ctor : ctors) {\n                if (RecordingAnnotationsUtil.isRecordableConstructor(ctor)) {\n                    selectedCtor = ctor;\n                    break;\n                }\n            }\n            if (selectedCtor != null) {\n                nonDefaultConstructorHolder = new NonDefaultConstructorHolder(selectedCtor, null);\n                final var parameterCount = selectedCtor.getParameterCount();\n                nonDefaultConstructorHandles = new DeferredParameter[parameterCount];\n                extractConstructorParameterNames(selectedCtor, constructorParamNameMap);\n\n                if (constructorParamNameMap.size() != parameterCount) {\n                    throw new IllegalArgumentException(\"Couldn't extract all parameters information for constructor \"\n                            + selectedCtor + \" for type \" + expectedType);\n                }\n            }\n        }\n\n        Set<String> handledProperties = new HashSet<>();\n        Property[] desc = PropertyUtils.getPropertyDescriptors(param);\n        FieldsHelper fieldsHelper = new FieldsHelper(param.getClass());\n        for (Property i : desc) {\n            if (!i.getDeclaringClass().getPackageName().startsWith(\"java.\")) {\n                // check if the getter is ignored\n                if ((i.getReadMethod() != null) && RecordingAnnotationsUtil.isIgnored(i.getReadMethod())) {\n                    continue;\n                }\n                // check if the matching field is ignored\n                Field field = fieldsHelper.getDeclaredField(i.getName());\n                if (field != null && ignoreField(field)) {\n                    continue;","sourceCodeStart":1256,"sourceCodeEnd":1292,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java#L1256-L1292","documentation":"For classes recorded via constructor-parameter extraction, Quarkus reflects on constructor parameter names to map them to fields/properties. If it cannot extract names for every parameter (constructorParamNameMap.size() != parameterCount), reconstruction cannot be guaranteed and recording is rejected. This usually means the class was compiled without -parameters (no LocalVariableTable/parameter name info) and no other name source (annotations, recorded metadata) exists.","triggerScenarios":"Recording an object whose selected constructor's parameter names cannot all be resolved — e.g. the class was compiled without the -parameters javac flag and parameter names are arg0, arg1...; a constructor using parameters not backed by matching fields.","commonSituations":"Third-party jars or prebuilt dependencies (compiled without -parameters) passed into @Record methods; native-image builds where parameter names are stripped; extension relying on reflected parameter names of a dependency class.","solutions":["Compile the class's module with -parameters (maven-compiler-plugin <parameters>true</parameters>)","Explicitly register the constructor and its parameter names with the recording machinery instead of relying on reflection","Rewrite the object into a type with a default constructor plus getters/setters so name extraction is not needed"],"exampleFix":"// before\n<artifact>maven-compiler-plugin</artifact> <!-- no config -->\n// after\n<configuration><parameters>true</parameters></configuration>","handlingStrategy":"validation","validationCode":"Parameter[] ps = ctor.getParameters();\nboolean allNamed = Arrays.stream(ps).allMatch(p ->\n    !p.isNamePresent() || !p.getName().matches(\"arg\\d+\"));\nif (!allNamed) throw new IllegalStateException(\"Compile \" + ctor.getDeclaringClass()\n    + \" with -parameters before recording\");","typeGuard":"boolean hasParameterNames(Constructor<?> c) {\n    return Arrays.stream(c.getParameters())\n        .allMatch(p -> p.isNamePresent() && !p.getName().matches(\"arg\\d+\"));\n}","tryCatchPattern":"try {\n    recorder.record(value);\n} catch (IllegalArgumentException e) {\n    if (String.valueOf(e.getMessage()).startsWith(\"Couldn't extract all parameters information\")) {\n        throw new IllegalStateException(\"Rebuild \" + value.getClass() + \" with -parameters\", e);\n    }\n    throw e;\n}","preventionTips":["Always build extension modules with maven-compiler-plugin <parameters>true</parameters>","Avoid recording third-party classes not compiled with -parameters","Prefer default-constructor beans over parameterized-constructor extraction"],"tags":["quarkus","bytecode-recording","reflection"],"backgroundTag":"missing-constructor-parameter-names","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"}