{"record":{"id":"1327008222e01bf8","repo":"quarkusio/quarkus","slug":"it-is-not-possible-to-specify-multiple-creation-me","errorCode":null,"errorMessage":"It is not possible to specify multiple creation methods","messagePattern":"It is not possible to specify multiple creation methods","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/SyntheticBeanBuildItem.java","lineNumber":298,"sourceCode":"        }\n\n        Function<SyntheticCreationalContext<?>, ?> getFunction() {\n            return fun;\n        }\n\n        Object getRuntimeProxy() {\n            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":280,"sourceCodeEnd":311,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/SyntheticBeanBuildItem.java#L280-L311","documentation":"SyntheticBeanBuildItem's configurator allows exactly one creation mechanism. checkMultipleCreationMethods() is called by supplier(), runtimeValue(), createWith() and runtimeProxy(), and throws IllegalStateException if any creation method was already set, preventing ambiguous bean instantiation strategies.","triggerScenarios":"Calling two or more of .supplier(), .runtimeValue(), .createWith(), or .runtimeProxy() on the same ExtendedBeanConfigurator before done().","commonSituations":"Copy-pasting configurator chains from other extensions; merging two bean registrations during refactoring; conditional code that adds a runtimeValue on top of an existing supplier.","solutions":["Keep only one creation call — remove the redundant .supplier()/.runtimeValue()/.createWith()/.runtimeProxy()","If both flavors are needed, build two separate SyntheticBeanBuildItems or choose one mechanism","Wrap configuration in a single method so creation is set exactly once","Review the diff for duplicated chained calls on the same configurator"],"exampleFix":"// before\nconfigure(Foo.class).supplier(recorder.foo()).runtimeValue(recorder.fooValue()).done();\n// after\nconfigure(Foo.class).supplier(recorder.foo()).done();","handlingStrategy":"validation","validationCode":"int creationCalls = countOf(supplier, runtimeValue, createWith, runtimeProxy); // keep == 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set the creation method exactly once per configurator","Centralize synthetic bean registration in one helper method","Grep configurator chains for duplicated creation calls during code review"],"tags":["cdi","synthetic-bean","build-time","extension-development"],"backgroundTag":"synthetic-bean-multiple-creation-methods","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"}