theonedev/onedev · warning · org.apache.wicket.authorization.UnauthorizedListenerInvocationException$ListenerInvocationNotAllowedException
Behavior rejected interface invocation.
Error message
Behavior rejected interface invocation.
What it means
Same guard as the component-level check, but applied to a Behavior attached to the component: behavior.canCallListenerInterface() returned false, usually because the behavior is temporarily disabled (isEnabled()) or its state no longer permits the call. Wicket logs a warning and re-renders the page instead of invoking the behavior's listener.
Source
Thrown at server-core/src/main/java/org/apache/wicket/RequestListenerInterface.java:247
*
* @param rcomponent
* The component
* @param behavior
* @throws ListenerInvocationNotAllowedException
* when listener invocation attempted on a component that does not allow it
*/
public final void invoke(final IRequestableComponent rcomponent, final Behavior behavior)
{
// we are in Wicket core land
final Component component = (Component)rcomponent;
HierarchicalContext.push(new HierarchicalContext(new ComponentHierarchical(component)));
try {
if (!behavior.canCallListenerInterface(component, method))
{
log.warn("behavior not enabled; ignore call. Behavior {} at component {}", behavior,
component);
throw new ListenerInvocationNotAllowedException(this, component, behavior,
"Behavior rejected interface invocation. ");
}
internalInvoke(component, behavior);
} finally {
HierarchicalContext.pop();
}
}
private void internalInvoke(final Component component, final Object target)
{
// save a reference to the page because the component can be removed
// during the invocation of the listener and thus lose its parent
Page page = component.getPage();
// initialization is required for stateless pages
if (!page.isInitialized())
{View on GitHub (pinned to d44925c47c)
Solutions
- Verify the behavior's isEnabled(component)/isStateless logic returns the same answer at render and request time
- If disabling intentionally, expect and accept the silent fail; remove client-side triggers too
- Ensure behaviors are added unconditionally (e.g. in onInitialize) when their listeners must always be callable
- Check that getStatelessHint and component reuse produce identical behavior attachment per request
Example fix
// before
behavior.setEnabled(false); // old Ajax call now rejected
// after
if (behavior.isEnabled(component)) {
// safe to invoke / render trigger
} Defensive patterns
Strategy: validation
Validate before calling
boolean callable = behavior.isEnabled(component) && component.isVisibleInHierarchy();
Try / catch
try {
processAjaxRequest();
} catch (ListenerInvocationNotAllowedException e) {
log.debug("Behavior callback rejected: {}", e.getMessage());
} Prevention
- Add behaviors unconditionally in onInitialize when their listeners must always respond
- Keep isEnabled/isStateless logic stable between render and request
- Avoid removing behaviors mid-session for components with live client-side triggers
When it happens
Trigger: An AjaxRequestBehavior/AbstractAjaxTimerBehavior or similar is disabled via behavior.setEnabled(false) or removed between render and the incoming callback; the behavior was added conditionally in onConfigure and the condition changed.
Common situations: Toggling behaviors dynamically (e.g. disabling auto-update behavior on some pages); state changes between page render and the Ajax round-trip; adding behaviors in onBeforeRender that don't get re-added identically on subsequent requests.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- Component rejected interface invocation
- Page classes should extend from BasePage.
- Base resource mapper should be used
- Invalid date range, expecting "yyyy-MM-dd to yyyy-MM-dd"
- Path '${mountPath}' should be mounted to a svg sprite resour
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/349389cb37de62db.
Report an issue: GitHub.