4

my app seems to work correctly, but in the console it throws a lot of StalePageExceptions. I dont know why. How can i debug the cause for this exceptions? What are commons reasons for this Exception?

13:32:29,361 WARN  [RequestCycleExtra] (default task-60) ********************************
13:32:29,362 WARN  [RequestCycleExtra] (default task-60) Handling the following exception: org.apache.wicket.core.request.mapper.StalePageException

13:32:29,363 WARN  [RequestCycleExtra] (default task-60) ********************************
13:32:35,626 WARN  [RequestCycleExtra] (default task-64) ********************************
13:32:35,627 WARN  [RequestCycleExtra] (default task-64) Handling the following exception: org.apache.wicket.core.request.mapper.StalePageException

I use the lastest Wicket version - 6.18 but i have this forever.

EDIT:

StatementGokListPanel.java

  columns.add(new StatementLinkColumn(Model.of("")) {
     @Override
     public void onClick(IModel<StatementGokCommunity> model, AjaxRequestTarget target) {
        ComponentMode componentMode = ComponentMode.EDIT;
        MarkupContainer mc = StatementGokListPanel.this.getParent();
        GokCommunityStatementPanel panel = new GokCommunityStatementPanel("panel", model.getObject(), componentMode, true);
        StatementGokListPanel.this.replaceWith(panel);
        target.add(mc);
     }
  });
Robert Niestroj
  • 15,299
  • 14
  • 76
  • 119

1 Answers1

5

The exception is being thrown if you try to use a page instance that has been rendered in another browser tab/window. Since Wicket cannot know whether you have changed the page structure in the other tab it just suppresses the action (e.g. link click, form submit, etc.) and re-renders the page instance with its latest state from the server.

The exception also may happen if you use browser's "View (page) source" functionality.

martin-g
  • 17,243
  • 2
  • 23
  • 35
  • I've updated my question. I found a reproducible place. ALways i click this link i get a StalePageExcaption. I dont have the app open in any other tab/browser. There must be some other reason. – Robert Niestroj Jan 12 '15 at 15:01
  • 3
    See Page#renderCount. Add a breakpoint and see why it increments when it is not expected to be incremented. – martin-g Jan 12 '15 at 15:31