{"record":{"id":"3ac5685f71acc324","repo":"quarkusio/quarkus","slug":"getter-accessors-container-has-not-been-initialize","errorCode":null,"errorMessage":"Getter accessors container has not been initialized","messagePattern":"Getter accessors container has not been initialized","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-links/runtime/src/main/java/io/quarkus/resteasy/reactive/links/runtime/RestLinksProviderImpl.java","lineNumber":90,"sourceCode":"    private Object[] getPathParameterValues(LinkInfo linkInfo, Object instance) {\n        List<Object> values = new ArrayList<>(linkInfo.getPathParameters().size());\n        for (String name : linkInfo.getPathParameters()) {\n            GetterAccessor accessor = getterAccessorsContainer.get(linkInfo.getEntityType(), name);\n            if (accessor != null) {\n                values.add(accessor.get(instance));\n            } else {\n                values.add(\"{\" + name + \"}\");\n            }\n        }\n        return values.toArray();\n    }\n\n    private void verifyInit() {\n        if (linksContainer == null) {\n            throw new IllegalStateException(\"Links context has not been initialized\");\n        }\n        if (getterAccessorsContainer == null) {\n            throw new IllegalStateException(\"Getter accessors container has not been initialized\");\n        }\n    }\n}\n","sourceCodeStart":72,"sourceCodeEnd":94,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-links/runtime/src/main/java/io/quarkus/resteasy/reactive/links/runtime/RestLinksProviderImpl.java#L72-L94","documentation":"The same verifyInit() check in RestLinksProviderImpl also verifies that the getter accessors container was initialized at build time. When it is null, getInstanceLinks() cannot resolve per-instance link property values, so this IllegalStateException is thrown. It signals the REST links build step did not record the getter accessors.","triggerScenarios":"Calling RestLinksProvider.get().getInstanceLinks(...) when the build-time initialization populated neither container (or the getters container specifically), typically because the extension's recorder did not run.","commonSituations":"Testing provider-dependent code outside Quarkus bootstrap; misconfigured dependency where runtime jar is present but the deployment processor is absent; accessing the provider too early in a custom harness.","solutions":["Add the quarkus-rest-links extension (including its deployment artifact) to the build so the recorder populates the accessor container","Call getInstanceLinks only after Quarkus finished booting","Use @QuarkusTest in tests to ensure full initialization","Avoid instantiating RestLinksProviderImpl manually in application code"],"exampleFix":"// before\nList<InstanceLinks> links = RestLinksProvider.get().getInstanceLinks(entity);\n// after\n@SpringBootTest-less Quarkus test:\n@QuarkusTest\nclass LinksTest { /* provider initialized by the platform */ }","handlingStrategy":"validation","validationCode":"if (getClass().getResource(\"/io/quarkus/resteasy/reactive/links/runtime\") == null) {\n    throw new SkipException(\"rest-links extension not in build\");\n}","typeGuard":"boolean hasInstanceLinks(Object entity) {\n    try { return !RestLinksProvider.get().getInstanceLinks(entity).isEmpty(); }\n    catch (IllegalStateException e) { return false; }\n}","tryCatchPattern":"try {\n    instanceLinks = RestLinksProvider.get().getInstanceLinks(entity);\n} catch (IllegalStateException e) {\n    throw new ConfigurationException(\"rest-links not initialized; add the extension\", e);\n}","preventionTips":["Verify quarkus-rest-links deployment artifact is on the build classpath","Call getInstanceLinks only from runtime request handling or post-startup observers","Bootstrap tests with @QuarkusTest","Do not hand-construct the provider"],"tags":["resteasy-reactive","rest-links","initialization","lifecycle"],"backgroundTag":"not-initialized","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"}