Skip to content

Name the page and path in the markup-not-found messages of Component - #2012

Closed
Robotcell wants to merge 3 commits into
apache:masterfrom
Robotcell:markup-not-found-message
Closed

Robotcell wants to merge 3 commits into
apache:masterfrom
Robotcell:markup-not-found-message

Conversation

@Robotcell

@Robotcell Robotcell commented Nov 25, 2026 •

Copy link
Copy Markdown

Fixes #1957

What changed

The two "markup not found" messages in Component (internalRender() -> MarkupNotFoundException, internalRenderComponent() -> MarkupException) now also name the page class and the page-relative path of the component, e.g. Markup not found for Component: [Component id = missing], page: com.example.MyPage, path: panel:missing. If an Ajax request handler is active, they add a hint that the parent's markup may not contain the component (e.g. it was invisible on first render). Only the message text changes; exception types are unchanged.

Not changed: the other MarkupNotFoundException sites in MarkupContainer/sourcing strategies, which are about missing markup files/fragments and already name them.

Testing

  • New ComponentMarkupNotFoundTest in wicket-core-tests asserts the page class and path in the message.
  • Ran mvn -Pfast -pl wicket-core-tests test -Dtest=ComponentMarkupNotFoundTest,PanelTest,LinkTest,SimplePageTest,ComponentMarkupIdTest: pass (JDK 25, release 21).
  • NOT run: full mvn clean verify, -Pjs-test, japicmp. The Ajax hint branch is not covered by a test.

AI disclosure

This change was prepared with Claude Code (AI assistance). The account owner did not review the code line by line. Local verification: only the mvn -Pfast ... test run listed under Testing. The full mvn clean verify, -Pjs-test and japicmp were not run. CI: awaiting maintainer approval; the Java CI workflow has not run. The commit message carries a Generated-by trailer, as recommended by the ASF generative tooling guidance.

🤖 Generated with Claude Code

The messages only had the component's class and id, so with several
components sharing an id such as 'feedback' it was impossible to tell which
one failed. They now also name the page class and the page-relative path of
the component. When the failure happens while an Ajax update renders, the
message adds a hint that the parent's markup may not contain the component.

Only the message text changes. The exception types are unchanged.

GitHub issue apache#1957

Generated-by: Claude Code (Claude Sonnet 5.5, claude-sonnet-5-5)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Robotcell
Robotcell force-pushed the markup-not-found-message branch 2 times, most recently from d7fd582 to 436918e Compare November 25, 2026 17:06
@dashorst dashorst added the good first issue Suitable for a first contribution to Wicket label Nov 25, 2026
@codecov-commenter

codecov-commenter commented Nov 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.21%. Comparing base (c419852) to head (1618c1c).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2012      +/-   ##
============================================
- Coverage     63.24%   63.21%   -0.03%     
+ Complexity    11737    11736       -1     
============================================
  Files          1255     1255              
  Lines         48981    48980       -1     
  Branches       6935     6935              
============================================
- Hits          30977    30965      -12     
- Misses        15316    15328      +12     
+ Partials       2688     2687       -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Replaced the existing markupNotFoundMessage method with a new implementation that builds a message for components without markup, including page and path details.
@bitstorm

Copy link
Copy Markdown
Contributor

Already included in PR #1966

@bitstorm bitstorm closed this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Suitable for a first contribution to Wicket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Say which page and path lack markup in MarkupNotFoundException

4 participants