{"record":{"id":"a05f9c91d03b3a23","repo":"quarkusio/quarkus","slug":"couldn-t-load-object-of-type-i-propertytype-getn","errorCode":null,"errorMessage":"Couldn't load object of type ${i.propertyType.getName()} for property '${i.getName()}' on object '${param}'. Please, check the Bytecode Recording documentation https://quarkus.io/guides/writing-extensions#bytecode-recording to be sure this type is supported to be passed to @Record classes.","messagePattern":"Couldn't load object of type (.+?) for property '(.+?)' on object '(.+?)'\\. Please, check the Bytecode Recording documentation https://quarkus\\.io/guides/writing-extensions#bytecode-recording to be sure this type is supported to be passed to @Record classes\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java","lineNumber":1445,"sourceCode":"                                    }\n\n                                }\n                            } else {\n                                throw new RuntimeException(\"Cannot serialise field '\" + i.getName() + \"' on object '\" + param\n                                        + \"' of type '\" + param.getClass().getName()\n                                        + \"' as getter and setter are of different types. Getter type is '\"\n                                        + getterReturnType.getName() + \"' while setter type is '\"\n                                        + setterParameterType.getName()\n                                        + \"'.\");\n                            }\n                        }\n                    }\n                    DeferredParameter val;\n                    try {\n                        val = loadObjectInstance(propertyValue, existing,\n                                i.getPropertyType(), relaxedValidation);\n                    } catch (Exception e) {\n                        throw new RuntimeException(\n                                \"Couldn't load object of type \" + i.propertyType.getName() + \" for property '\" + i.getName()\n                                        + \"' on object '\" + param\n                                        + \"'. Please, check the Bytecode Recording documentation \" +\n                                        \"https://quarkus.io/guides/writing-extensions#bytecode-recording to be sure this type \"\n                                        +\n                                        \"is supported to be passed to @Record classes.\",\n                                e);\n                    }\n                    if (ctorParamIndex != null) {\n                        nonDefaultConstructorHandles[ctorParamIndex] = val;\n                        ctorSetupSteps.add(new SerializationStep() {\n                            @Override\n                            public void handle(MethodContext context, MethodCreator method, DeferredArrayStoreParameter out) {\n\n                            }\n\n                            @Override\n                            public void prepare(MethodContext context) {","sourceCodeStart":1427,"sourceCodeEnd":1463,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java#L1427-L1463","documentation":"While serializing a bean property, loadObjectInstance could not produce a deferred bytecode value for the property value — the property's type is not among the types the bytecode recorder supports (primitives, Strings, enums, collections, maps, registered serializers, other recordable objects, etc.). The error links to the Bytecode Recording docs listing supported types.","triggerScenarios":"Passing an object with a property of an unsupported type (e.g. java.time custom types without a registered serializer, arbitrary third-party classes, Class<?> handles, lambdas) into a @Record method.","commonSituations":"Extension config classes containing exotic types; adding a new field of a non-recordable type to an otherwise recordable config object; forgetting to register a ObjectSerializer for a custom type via RegisterForBytecodeRecording or a serialization customizer.","solutions":["Register a custom serializer for the type (implement io.quarkus.deployment.recording.ObjectSerializer and register it)","Change the property type to a supported one (String, primitives, enums, collections/maps of supported types)","Annotate the value class with @io.quarkus.runtime.annotations.RegisterForBytecodeRecording if it is a simple bean","Precompute/transform the value into a supported representation before passing it to the @Record method"],"exampleFix":"// before\nrecord Config(URI endpoint) {} // URI unsupported in this spot\n// after\nrecord Config(String endpoint) {} // pass endpoint.toString()","handlingStrategy":"validation","validationCode":"static final Set<Class<?>> SUPPORTED = Set.of(String.class, int.class, boolean.class,\n    Integer.class, Boolean.class, List.class, Set.class, Map.class);\nif (!SUPPORTED.contains(propType) && !propType.isEnum()\n    && !propType.isAnnotationPresent(RegisterForBytecodeRecording.class)) {\n    throw new IllegalStateException(\"Type not recordable: \" + propType);\n}","typeGuard":null,"tryCatchPattern":"try {\n    recorder.record(value);\n} catch (RuntimeException e) {\n    if (String.valueOf(e.getMessage()).startsWith(\"Couldn't load object of type\")) {\n        throw new IllegalStateException(\"Register a serializer or change the property type\", e);\n    }\n    throw e;\n}","preventionTips":["Restrict recorded bean properties to documented supported types","Register custom ObjectSerializers for required exotic types","Annotate simple value classes with @RegisterForBytecodeRecording","Convert complex types to Strings/maps before passing to @Record methods"],"tags":["quarkus","bytecode-recording","serialization"],"backgroundTag":"unrecordable-type","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"}