[
https://issues.apache.org/jira/browse/WICKET-6109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15192288#comment-15192288
]
Andrea Aime commented on WICKET-6109:
-------------------------------------
Hi, I'm tracking an issue found in Wicket 7.2 and stumbled upon this change...
wondering if it's a different symptom of the same problem.
Basically I have a base page with a <message> tag, with multiple subpages also
using <message> tags. The first subpage gets instantiated and this message tag
gets a id like "wicket_message33", then another sub-page gets instantiated, a
new counter gets built to generate the ids, and one of its message tags (in the
subpage) also gets "wicket_message33" as its id, and then we get an exception
from Page complaining the same component has been rendered twice.
Andrea, looking at your change it might seem that it would fix the above issue
too.
> Enclosure - "IllegalArgumentException: Argument 'markup' may not be null"
> after app restart
> -------------------------------------------------------------------------------------------
>
> Key: WICKET-6109
> URL: https://issues.apache.org/jira/browse/WICKET-6109
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 7.2.0
> Reporter: Vlastimil
> Assignee: Andrea Del Bene
> Fix For: 7.3.0, 8.0.0-M1
>
> Attachments: enclosure-id-quickstart.zip
>
>
> I've debugged it a bit and this is what happens:
> # Open some page with enclosure
> # Markup is parsed - {{ComponentTag}} of enclosure gets id:
> {{wicket_enclosure1011}}
> # {{Enclosure}} component is created and gets id from {{ComponentTag}}:
> {{wicket_enclosure1011}}
> # Page is rendered in browser - everything ok sofar
> # Restart server
> # Hit F5 in browser
> # Markup is parsed - {{ComponentTag}} of enclosure gets different id than in
> the first request: {{wicket_enclosure112113}}
> # {{Enclosure}} component is not created again (it is taken from page map??)
> - but this component has id from first request: {{wicket_enclosure1011}}
> # {{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.
> # This obviously fails and markup is not found which results in this exception
> {code}
> 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
> {code}
> 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:
> # Start quickstart
> # Go to {{localhost:8888}}
> # Click on Go to page 2
> # Restart the server
> # Hit F5 in the browser
> Note that session persistance is enabled.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)