ListenerRequestHandler.detach() can trigger rendering callbacks after the response has been flushed
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with ListenerRequestHandler.detach(), where ListenerLogData is built before the provider detaches, then follow PageLogData.optional() into PageAndComponentProvider.getComponent(), which calls internalInitialize() and beforeRender(). WicketFilter.processRequestCycle() shows the call order after the response flush. Done when the isolated reproduction (missing component on a stateless page, request logger disabled) records 0 onBeforeRender() calls during detach, while normal component resolution during request processing still works.
由索引模型根据 Issue 内容生成。
描述
ListenerRequestHandler.detach() can trigger rendering callbacks after the response has been flushed
Description
We observed HTTP session creation during request detachment, after the response had already been committed. Consequently, the servlet container could not send the session cookie and logged SESN0066E and SRVE8114W.
The production stack trace identifies Wicket’s collection of listener log data as the entry point.
Environment
- Wicket: 10.11.0
- Application server: Open Liberty 26.0.0.10 (from 25.0.0.1+ onwards seen)
- Platform: Jakarta EE 11 / Servlet 6.1
- CDI implementation: Weld 6.0.2
- Production JDK: OpenJDK 25.0.4
- Isolated reproduction JDK: 27
Relevant code path
In Wicket 10.11.0:
WicketFilter.processRequestCycle()processes the request, flushes the response, and subsequently callsrequestCycle.detach()in itsfinallyblock.ListenerRequestHandler.detach()constructsListenerLogDatabefore detaching the page/component provider.ListenerLogDatacallspageAndComponentProvider.getComponent()to obtain component metadata.- If the component cannot be found on a stateless page,
PageAndComponentProvider.getComponent()callsinternalInitialize()andbeforeRender()to allow lifecycle callbacks to create the component. - These callbacks therefore run during detachment, after the response flush.
In our application, this reaches a component’s onConfigure(), which checks the login state through a CDI @SessionScoped bean. Resolving the bean causes the container to create an HTTP session.
Production stack trace
Abbreviated stack, with the innermost call first:
SessionManager.createSession()
...
SessionHolder.getSession()
LazySessionBeanStore.getSession()
...
KontoBean$WeldClientProxy.isLoggedIn()
AccountHeader2017.onConfigure(AccountHeader2017.java:46)
Component.configure(Component.java:996)
...
Component.beforeRender(Component.java:949)
PageAndComponentProvider.getComponent(PageAndComponentProvider.java:176)
ListenerLogData.lambda$new$0(ListenerLogData.java:54)
PageLogData.optional(PageLogData.java:63)
ListenerLogData.<init>(ListenerLogData.java:54)
ListenerRequestHandler.detach(ListenerRequestHandler.java:128)
...
WicketFilter.processRequestCycle(WicketFilter.java:285)
Isolated reproduction
Using BaseWicketTester:
- Create a bookmarkable stateless page.
- Create a
PageAndComponentProviderpointing to a missing component. - Create a
ListenerRequestHandlerusing that provider. - Disable the request logger.
- Call
handler.detach()and countonBeforeRender()invocations.
Results
| Case | onBeforeRender() calls during detach |
|---|---|
| Missing component, stateless page, request logger disabled | 2 |
| Existing component, stateless page | 0 |
| Missing component, stateful page | 0 |
| Component created and resolved before detach | 0 |
This reproduces the lifecycle behavior without Brix or application code.
Scope of the reproduction
The isolated test calls detach() directly. It does not reproduce the complete Liberty/CDI request or an actual HTTP response commit.
The cookie failure is evidenced separately by the production FFDC stack. The original triggering request URL is unavailable.
Additional observations
Disabling request logging does not prevent the behavior: ListenerRequestHandler.detach() constructs the log data independently of that setting.
PageLogData.optional() catches lookup exceptions but cannot prevent the lifecycle side effects caused by getComponent().
Expected behavior
Collecting diagnostic metadata during detachment should not initialize components or invoke rendering callbacks. An unresolved component should yield incomplete/null log metadata while cleanup still proceeds.
A fix should preserve normal component resolution during request processing, including components legitimately created in lifecycle callbacks, while avoiding that resolution as a side effect of log-data collection after response flush.
- 主要语言
- Java
- 星标
- 800
- 派生
- 437
- 平均合并
- 21 小时 36 分钟
- 30 天内合并 PR
- 167
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/wicket 的其他 Issue
-
PropertyResolver fails on JDK classes with a non-public field named like the property可能已有人在做 @vaibhavgupta443 今天认领。 未关闭good first issue
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
Stop the autocomplete from accumulating request parameters while typing可能已有人在做 @aryankalantri 今天认领。 未关闭good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
Validate the report-uri value given to CSPHeaderConfiguration#reportBack可能已有人在做 @AzizOuertani 于 3 天前认领。 未关闭good first issue
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
维护者通常 6 天内回复
-
account assessment course feature lecture
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
bug db/dameng user-priority/P2
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
app:learninggoalhub enhancement good first issue
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100