You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2013/03/21 11:09:15 UTC

[jira] [Updated] (WICKET-5073) UrlRenderer#removeCommonPrefixes() fails when contextPath+filterPrefix has more segments than the argument

     [ https://issues.apache.org/jira/browse/WICKET-5073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-5073:
------------------------------------

    Summary: UrlRenderer#removeCommonPrefixes() fails when contextPath+filterPrefix has more segments than the argument  (was: Internal exception in UrlRenderer)
    
> UrlRenderer#removeCommonPrefixes() fails when contextPath+filterPrefix has more segments than the argument
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-5073
>                 URL: https://issues.apache.org/jira/browse/WICKET-5073
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.6.0
>            Reporter: Christoph Leiter
>            Assignee: Sven Meier
>         Attachments: WICKET-5073-quickstart.zip
>
>
> I get this exception when trying to create a URL with RequestCycle#urlFor:
> org.apache.wicket.WicketRuntimeException: An error occurred while generating an Url for handler 'ResourceReferenceRequestHandler{resourceReference=scope: org.apache.wicket.Application; name: ImageResource; locale: null; style: null; variation: null, pageParameters=publicId=[f74df62d-cbdb-49db-96e4-36e3ea62610e], type=[sr]}'
>         at org.apache.wicket.request.cycle.RequestCycle.urlFor(RequestCycle.java:516) [wicket-core-6.6.0.jar:6.6.0]
>         at org.apache.wicket.request.cycle.RequestCycle.urlFor(RequestCycle.java:473) [wicket-core-6.6.0.jar:6.6.0]
>         at xxx.XXXWebApplication.urlFor(XXXWebApplication.java:161) ~[xxx-web-0.1.0-SNAPSHOT.jar:0.1.0-SNAPSHOT]
> [...]
> Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>         at java.util.ArrayList.rangeCheck(ArrayList.java:604) ~[na:1.7.0_10]
>         at java.util.ArrayList.remove(ArrayList.java:445) ~[na:1.7.0_10]
>         at org.apache.wicket.request.UrlRenderer.removeCommonPrefixes(UrlRenderer.java:319) ~[wicket-request-6.6.0.jar:6.6.0]
>         at org.apache.wicket.request.UrlRenderer.renderRelativeUrl(UrlRenderer.java:220) ~[wicket-request-6.6.0.jar:6.6.0]
>         at org.apache.wicket.request.UrlRenderer.renderUrl(UrlRenderer.java:117) ~[wicket-request-6.6.0.jar:6.6.0]
>         at org.apache.wicket.request.cycle.RequestCycle.renderUrl(RequestCycle.java:529) [wicket-core-6.6.0.jar:6.6.0]
>         at org.apache.wicket.request.cycle.RequestCycle.urlFor(RequestCycle.java:511) [wicket-core-6.6.0.jar:6.6.0]
>         ... 46 common frames omitted
> The app uses a context path and no filter path. I see that UrlRenderer#removeCommonPrefixes receives an empty list and the code in the method assumes that context path + filter path is always a common prefix and tries to remove it later from the empty list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira