{"record":{"id":"c53f7a5e11c2be64","repo":"theonedev/onedev","slug":"has-not-been-properly-detached-something-in-the","errorCode":null,"errorMessage":" has not been properly detached. Something in the hierarchy of ","messagePattern":" has not been properly detached\\. Something in the hierarchy of ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/org/apache/wicket/Component.java","lineNumber":931,"sourceCode":"\t/**\n\t * Called on every component after the page is rendered. It will call onAfterRender for it self\n\t * and its children.\n\t */\n\tpublic final void afterRender()\n\t{\n\t\ttry\n\t\t{\n\t\t\tsetFlag(FLAG_AFTER_RENDERING, true);\n\n\t\t\t// always detach children because components can be attached\n\t\t\t// independently of their parents\n\t\t\tonAfterRenderChildren();\n\n\t\t\tonAfterRender();\n\t\t\tgetApplication().getComponentOnAfterRenderListeners().onAfterRender(this);\n\t\t\tif (getFlag(FLAG_AFTER_RENDERING))\n\t\t\t{\n\t\t\t\tthrow new IllegalStateException(Component.class.getName() +\n\t\t\t\t\t\" has not been properly detached. Something in the hierarchy of \" +\n\t\t\t\t\tgetClass().getName() +\n\t\t\t\t\t\" has not called super.onAfterRender() in the override of onAfterRender() method\");\n\t\t\t}\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\t// this flag must always be set to false.\n\t\t\tmarkRendering(false);\n\t\t}\n\t}\n\n\t/**\n\t * \n\t */\n\tprivate void internalBeforeRender()\n\t{\n\t\tconfigure();","sourceCodeStart":913,"sourceCodeEnd":949,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/apache/wicket/Component.java#L913-L949","documentation":"After rendering, Component checks FLAG_AFTER_RENDERING; this flag is cleared only in Component.onAfterRender(). If an override of onAfterRender() in the hierarchy does not call super.onAfterRender(), the flag remains set and Wicket throws this IllegalStateException, indicating the render lifecycle was not completed cleanly.","triggerScenarios":"An override of onAfterRender() omits super.onAfterRender(); the component finishes rendering and Wicket performs the post-render check.","commonSituations":"Custom components adding cleanup logic to onAfterRender(); code migrated from Wicket versions that did not verify super calls.","solutions":["Find the onAfterRender() override in the named class hierarchy","Add super.onAfterRender() to the override","Verify no early return/exception path skips the super call"],"exampleFix":"// before\n@Override\nprotected void onAfterRender() {\n    cleanup();\n}\n// after\n@Override\nprotected void onAfterRender() {\n    super.onAfterRender();\n    cleanup();\n}","handlingStrategy":"validation","validationCode":"@Override\nprotected void onAfterRender() {\n    try {\n        cleanup();\n    } finally {\n        super.onAfterRender();\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap your onAfterRender body in try/finally with super.onAfterRender() in finally","Keep onAfterRender overrides minimal"],"tags":["wicket","lifecycle","rendering"],"backgroundTag":"method-not-implemented","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}