Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6093

MarkupException due to ID collision in RelativePathPrefixHandler

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.1.0, 7.2.0
    • Fix Version/s: 7.3.0
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Windows 10 x64, Java 8 u65, Quickstart

      Description

      I get the following exception after refreshing a stateful page via F5:

      23:21:30.945 [qtp1454031203-14] DEBUG org.apache.wicket.Page - Rendered [TransparentWebMarkupContainer [Component id = wicket_relative_path_prefix_0]]
      23:21:30.948 [qtp1454031203-14] DEBUG org.apache.wicket.Page - Rendered [TransparentWebMarkupContainer [Component id = wicket_relative_path_prefix_1]]
      23:21:30.948 [qtp1454031203-14] DEBUG org.apache.wicket.Page - Rendered [WicketHeadContainer [Component id = _header_]]
      23:21:30.948 [qtp1454031203-14] DEBUG org.apache.wicket.Page - Rendered [HtmlHeaderContainer [Component id = _header_]]
      23:21:30.949 [qtp1454031203-14] DEBUG org.apache.wicket.Page - Rendered [TransparentWebMarkupContainer [Component id = wicket_relative_path_prefix_1]]
      23:21:30.949 [qtp1454031203-14] DEBUG org.apache.wicket.Page - Rendered [Component id = version]
      23:21:30.949 [qtp1454031203-14] DEBUG org.apache.wicket.Page - Rendered [AutolinkBookmarkablePageLink [Component id = _autolink_4]]
      23:21:30.949 [qtp1454031203-14] DEBUG org.apache.wicket.Page - Rendered [TransparentWebMarkupContainer [Component id = wicket_link3]]
      23:21:30.950 [qtp1454031203-14] DEBUG org.apache.wicket.Page - Rendered [Page class = com.mycompany.Page2, id = 0, render count = 1]
      23:21:30.951 [qtp1454031203-14] DEBUG org.apache.wicket.Page - ending request for page [Page class = com.mycompany.Page2, id = 0, render count = 1], request org.apache.wicket.protocol.http.servlet.ServletWebRequest@27d8cf0a
      23:21:39.337 [qtp1454031203-27] DEBUG org.apache.wicket.Page - Rendered [TransparentWebMarkupContainer [Component id = wicket_relative_path_prefix_0]]
      23:21:39.337 [qtp1454031203-27] DEBUG org.apache.wicket.Page - Rendered [TransparentWebMarkupContainer [Component id = wicket_relative_path_prefix_1]]
      23:21:39.337 [qtp1454031203-27] DEBUG org.apache.wicket.Page - Rendered [WicketHeadContainer [Component id = _header_]]
      23:21:39.337 [qtp1454031203-27] DEBUG org.apache.wicket.Page - Rendered [HtmlHeaderContainer [Component id = _header_]]
      23:21:39.339 [qtp1454031203-27] WARN  RequestCycleExtra - ********************************
      23:21:39.339 [qtp1454031203-27] WARN  RequestCycleExtra - Handling the following exception
      org.apache.wicket.markup.MarkupException: The component [TransparentWebMarkupContainer [Component id = wicket_relative_path_prefix_1]] was rendered already. You can render it only once during a render phase. Class relative path: org.apache.wicket.markup.html.TransparentWebMarkupContainer:wicket_relative_path_prefix_1
      	at org.apache.wicket.Page.componentRendered(Page.java:211) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.Component.rendered(Component.java:2623) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.Component.internalRender(Component.java:2384) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.Component.render(Component.java:2308) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1524) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1759) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.Page.onRender(Page.java:879) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:141) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.Component.internalRender(Component.java:2380) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.Component.render(Component.java:2308) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.Page.renderPage(Page.java:1018) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:124) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:195) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) ~[wicket-request-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265) [wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222) [wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293) [wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261) [wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203) [wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284) [wicket-core-7.2.0.jar:7.2.0]
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.Server.handle(Server.java:499) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) [jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]
      

      The attached Quickstart reproduces the issue:

      1. Click the link to Page 2
      2. Press F5 to reload

      I believe the issue was introduced by the fix for WICKET-5904 (commit https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=32a40bc ), which introduces a request-local ID generator for autocomponents. The IDs are stored along with the tags in the global MarkupCache, which can lead to collisions if the IDs are generated incrementally.

      The mentioned crash can be observed in Wicket 7.2.0 and 7.3.0-SNAPSHOT, whereas 7.1.0 behaves differently and renders invalid markup, replacing the 2nd occurence of the colliding ID by the markup of the first.

        Attachments

        1. quickstart.zip
          27 kB
          Matthias Piepkorn

          Issue Links

            Activity

              People

              • Assignee:
                bitstorm Andrea Del Bene
                Reporter:
                mpiepk Matthias Piepkorn
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: