{"record":{"id":"4e69ce322852555a","repo":"quarkusio/quarkus","slug":"failed-to-initialize","errorCode":null,"errorMessage":"Failed to initialize  ","messagePattern":"Failed to initialize  ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-links/runtime/src/main/java/io/quarkus/resteasy/reactive/links/runtime/GetterAccessorsContainerRecorder.java","lineNumber":30,"sourceCode":"    public RuntimeValue<GetterAccessorsContainer> newContainer() {\n        return new RuntimeValue<>(new GetterAccessorsContainer());\n    }\n\n    /**\n     * Add a getter accessor to a container.\n     */\n    public void addAccessor(RuntimeValue<GetterAccessorsContainer> container, String className, String fieldName,\n            String accessorName) {\n        try {\n            // Create a new accessor object early\n            GetterAccessor accessor = (GetterAccessor) Thread.currentThread()\n                    .getContextClassLoader()\n                    .loadClass(accessorName)\n                    .getDeclaredConstructor()\n                    .newInstance();\n            container.getValue().put(className, fieldName, accessor);\n        } catch (Exception e) {\n            throw new RuntimeException(\"Failed to initialize \" + accessorName + \": \" + e.getMessage());\n        }\n    }\n}\n","sourceCodeStart":12,"sourceCodeEnd":34,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-links/runtime/src/main/java/io/quarkus/resteasy/reactive/links/runtime/GetterAccessorsContainerRecorder.java#L12-L34","documentation":"GetterAccessorsContainerRecorder.addAccessor runs at build/record time: it instantiates a generated accessor class and registers it in the runtime container. Any exception (class not found, instantiation failure, reflection error) is wrapped in RuntimeException 'Failed to initialize <accessorName>: <cause>'.","triggerScenarios":"Bytecode-generated accessor class cannot be loaded or instantiated — typically from a stale/partial build output, or the generated class was skipped (e.g. after a failed incremental build), or its no-arg constructor is unavailable.","commonSituations":"Incremental-build corruption after refactoring entities; IDE/Quarkus dev-mode stale state; multi-module builds where the deployment module output is outdated.","solutions":["Run a clean full build (./mvnw clean install -Dquickly or clean in dev mode) to regenerate accessor classes.","Check the wrapped cause message for the real reflection failure and fix that (e.g. missing class, no no-arg constructor).","If in dev mode, restart quarkus:dev to clear stale generated classes."],"exampleFix":"# before: stale incremental build\n./mvnw install\n# after\n./mvnw clean install -Dquickly","handlingStrategy":"try-catch","validationCode":"// usually not user-fixable; guard startup\ncheckState(generatedAccessorAvailable)","typeGuard":null,"tryCatchPattern":"catch (e: RuntimeException) {\n  if (e.message?.startsWith(\"Failed to initialize\") == true) {\n    logger.error(\"Accessor init failed (${e.message}); do a clean rebuild\")\n  }\n  throw e\n}","preventionTips":["Avoid stale incremental builds; clean after refactors","Read the wrapped cause for the real error","Restart dev mode when generated-code state looks inconsistent"],"tags":["build-time","reflection","rest-links"],"backgroundTag":"class-not-found","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"}