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

Enclosure - "IllegalArgumentException: Argument 'markup' may not be null" after app restart

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.2.0
    • Fix Version/s: 7.3.0, 8.0.0-M1
    • Component/s: wicket
    • Labels:
      None

      Description

      I've debugged it a bit and this is what happens:

      1. Open some page with enclosure
      2. Markup is parsed - ComponentTag of enclosure gets id: wicket_enclosure1011
      3. Enclosure component is created and gets id from ComponentTag: wicket_enclosure1011
      4. Page is rendered in browser - everything ok sofar
      5. Restart server
      6. Hit F5 in browser
      7. Markup is parsed - ComponentTag of enclosure gets different id than in the first request: wicket_enclosure112113
      8. Enclosure component is not created again (it is taken from page map??) - but this component has id from first request: wicket_enclosure1011
      9. Enclosure.getMarkup() is called which delegates search to AssociatedMarkupSourcingStrategy.getMarkup() and here on line 117 it tries to find markup of enclosure by wrong id.
      10. This obviously fails and markup is not found which results in this exception
      java.lang.IllegalArgumentException: Argument 'markup' may not be null.
      	at org.apache.wicket.util.lang.Args.notNull(Args.java:41) ~[wicket-util-7.3.0-SNAPSHOT.jar:7.3.0-SNAPSHOT]
      	at org.apache.wicket.markup.MarkupStream.<init>(MarkupStream.java:65) ~[wicket-core-7.3.0-SNAPSHOT.jar:7.3.0-SNAPSHOT]
      	at org.apache.wicket.markup.html.internal.Enclosure.getChild(Enclosure.java:136) ~[wicket-core-7.3.0-SNAPSHOT.jar:7.3.0-SNAPSHOT]
      	at org.apache.wicket.markup.html.internal.Enclosure.onConfigure(Enclosure.java:178) ~[wicket-core-7.3.0-SNAPSHOT.jar:7.3.0-SNAPSHOT]
      	at org.apache.wicket.Component.configure(Component.java:1055) ~[wicket-core-7.3.0-SNAPSHOT.jar:7.3.0-SNAPSHOT]
      	at org.apache.wicket.Component.internalBeforeRender(Component.java:940) ~[wicket-core-7.3.0-SNAPSHOT.jar:7.3.0-SNAPSHOT]
      	at org.apache.wicket.Component.beforeRender(Component.java:1017) ~[wicket-core-7.3.0-SNAPSHOT.jar:7.3.0-SNAPSHOT]
      	at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1831) ~[wicket-core-7.3.0-SNAPSHOT.jar:7.3.0-SNAPSHOT]
      	... 55 common frames omitted
      

      I will try to create a quickstart, but I don't know if I will be able to simulate this on simple page. Id of the enclosure is created by AbstractMarkupFilter.getRequestUniqueId() so the only way the id could be different is that another components call getRequestUniqueId() in different order each time. (or maybe I'am wrong.. )

      EDIT:
      Please see the attached quickstart. Steps to reproduce:

      1. Start quickstart
      2. Go to localhost:8888
      3. Click on Go to page 2
      4. Restart the server
      5. Hit F5 in the browser

      Note that session persistance is enabled.

        Attachments

        1. enclosure-id-quickstart.zip
          28 kB
          Vlastimil

          Issue Links

            Activity

              People

              • Assignee:
                bitstorm Andrea Del Bene
                Reporter:
                vlastimil.dolejs Vlastimil
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: