{"record":{"id":"838ef72a8f3422dd","repo":"theonedev/onedev","slug":"component-rejected-interface-invocation","errorCode":null,"errorMessage":"Component rejected interface invocation","messagePattern":"Component rejected interface invocation","errorType":"exception","errorClass":"org.apache.wicket.authorization.UnauthorizedListenerInvocationException$ListenerInvocationNotAllowedException","httpStatus":null,"severity":"warning","filePath":"server-core/src/main/java/org/apache/wicket/RequestListenerInterface.java","lineNumber":217,"sourceCode":"\t * @param rcomponent\n\t *            The component\n\t * \n\t * @throws ListenerInvocationNotAllowedException\n\t *             when listener invocation attempted on a component that does not allow it\n\t */\n\tpublic final void invoke(final IRequestableComponent rcomponent)\n\t{\n\t\t// we are in Wicket core land\n\t\tfinal Component component = (Component)rcomponent;\n\n\t\tHierarchicalContext.push(new HierarchicalContext(new ComponentHierarchical(component)));\n\t\ttry {\n\t\t\tif (!component.canCallListenerInterface(method))\n\t\t\t{\n\t\t\t\t// just return so that we have a silent fail and just re-render the\n\t\t\t\t// page\n\t\t\t\tlog.info(\"component not enabled or visible; ignoring call. Component: \" + component);\n\t\t\t\tthrow new ListenerInvocationNotAllowedException(this, component, null,\n\t\t\t\t\t\"Component rejected interface invocation\");\n\t\t\t}\n\t\n\t\t\tinternalInvoke(component, component);\n\t\t} finally {\n\t\t\tHierarchicalContext.pop();\n\t\t}\n\t}\n\n\t/**\n\t * Invokes a given interface on a component's behavior.\n\t * \n\t * @param rcomponent\n\t *            The component\n\t * @param behavior\n\t * @throws ListenerInvocationNotAllowedException\n\t *             when listener invocation attempted on a component that does not allow it\n\t */","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/apache/wicket/RequestListenerInterface.java#L199-L235","documentation":"Wicket throws ListenerInvocationNotAllowedException when a request targets a listener interface (e.g. an Ajax/Link onClick) on a component that fails canCallListenerInterface() — typically because the component is not visible or not enabled at request time. This is a deliberate silent-fail guard against stale or forged callbacks: the page is simply re-rendered instead of invoking the handler.","triggerScenarios":"Clicking a link/Ajax button whose component has setVisible(false) or setEnabled(false) on the server since the page was rendered; replaying a stale request after state change; bookmarking/re-rendering a page where the component was removed or conditionally hidden.","commonSituations":"Conditional UI rendering differs between render and request (e.g. visibility depends on user role or model data that changed); back-button navigation to an outdated page; stateless pages where component state was not recreated identically.","solutions":["Check why the component is not visible/enabled on the server for this request — align the visibility logic between render and request phases","If hiding intentionally, also disable the component or replace it so clients cannot post stale callbacks","Use setVisibilityAllowed vs setVisible correctly and keep model state consistent across requests","Log the component path in a custom IRequestCycleListener to identify which component/callback is affected"],"exampleFix":"// before\nlink.setVisible(user.isAdmin()); // hidden later, but browser still has old callback URL\n// after\nlink.setVisible(user.isAdmin());\nlink.setEnabled(user.isAdmin()); // guard both dimensions, or remove the link entirely","handlingStrategy":"validation","validationCode":"if (component.isVisibleInHierarchy() && component.isEnabledInHierarchy()) {\n    // safe: listener invocation will be accepted\n}","typeGuard":null,"tryCatchPattern":"try {\n    target.scheduleComponentRender(component);\n} catch (ListenerInvocationNotAllowedException e) {\n    log.warn(\"Stale callback ignored: {}\", e.getMessage());\n    target.add(page); // re-render silently\n}","preventionTips":["Keep visibility/enabled logic deterministic across render and request phases","Remove or disable client triggers when hiding components server-side","Watch logs for 'component not enabled or visible; ignoring call' to find affected components"],"tags":["wicket","component-lifecycle","stale-request"],"backgroundTag":"invalid-state-transition","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"}