{"record":{"id":"ed43ceeefab83936","repo":"quarkusio/quarkus","slug":"the-object-is-not-a-proxy-returned-from-a-recorder","errorCode":null,"errorMessage":"The object is not a proxy returned from a recorder method: <object.toString()>","messagePattern":"The object is not a proxy returned from a recorder method: <object\\.toString\\(\\)>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/SyntheticBeanBuildItem.java","lineNumber":305,"sourceCode":"            return runtimeProxy;\n        }\n\n        Supplier<ActiveResult> getCheckActive() {\n            return checkActive;\n        }\n\n        private void checkMultipleCreationMethods() {\n            if (runtimeProxy == null && runtimeValue == null && supplier == null && fun == null) {\n                return;\n            }\n            throw new IllegalStateException(\"It is not possible to specify multiple creation methods\");\n        }\n\n        private void checkReturnedProxy(Object object) {\n            if (object instanceof ReturnedProxy) {\n                return;\n            }\n            throw new IllegalArgumentException(\n                    \"The object is not a proxy returned from a recorder method: \" + object.toString());\n        }\n\n    }\n}\n","sourceCodeStart":287,"sourceCodeEnd":311,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/SyntheticBeanBuildItem.java#L287-L311","documentation":"Recorder methods return runtime proxy objects (ReturnedProxy) that stand in for runtime values produced at build time. checkReturnedProxy validates that the object passed to supplier/runtimeValue/createWith/runtimeProxy/checkActive is such a recorder proxy; if not, the value could never be resolved at runtime, so it throws this IllegalArgumentException.","triggerScenarios":"Passing a plain object, lambda, or a non-recorder return value to .supplier(obj), .runtimeValue(obj), .createWith(obj), .runtimeProxy(obj) or .checkActive(obj) instead of the result of a @Recorder method invoked in the build step (a non-recordable method, or a value computed in Java).","commonSituations":"Calling a recorder method that returns a concrete class not proxied by the recorder framework; accidentally new-ing the object in the build step; using a helper that unwraps the proxy.","solutions":["Ensure the argument is the direct return value of a @Recorder method called in the deployment code","Check the recorder method is not final/private and its return type is recordable","Do not instantiate the value yourself — move construction into the recorder method","If a constant is needed, configure it via other means (e.g. a creator lambda) rather than passing the raw object"],"exampleFix":"// before\n.configure(Foo.class).runtimeValue(new Foo());\n// after\n.configure(Foo.class).runtimeValue(recorder.createFoo()); // @Recorder method","handlingStrategy":"type-guard","validationCode":"if (!(value instanceof ReturnedProxy)) {\n    throw new IllegalArgumentException(\"Pass the result of a @Recorder method, not \" + value);\n}","typeGuard":"static boolean isRecorderProxy(Object o) {\n    return o instanceof io.quarkus.runtime.annotations.Recorder.ReturnedProxy\n        || o.getClass().getName().contains(\"RecorderProxy\");\n}","tryCatchPattern":null,"preventionTips":["Always pass the direct return value of a @Recorder method invoked in the build step","Never construct the object manually in deployment code","Check the recorder method's return type is recordable"],"tags":["cdi","recorder","synthetic-bean","build-time"],"backgroundTag":"not-a-recorder-proxy","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"}