Wicket
  1. Wicket
  2. WICKET-4303

mounting a home page with package mapper results in invalid url's

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.3, 6.0.0-beta1
    • Fix Version/s: 1.5.4, 6.0.0-beta1
    • Component/s: wicket
    • Labels:
    • Environment:
      Internet Explorer,Chrome (Probably occurs in any browser)

      Description

      If the transition destination page mountPackage HomePage, which displays a 404 error when you click on the link the normal component.
      This would not be a bug?
      When you reload before click, the issue does not occur.

      Wicket 1.4 this issue does not happen.

      The stack trace below.
      WARN - WicketObjects - Could not resolve class [wicket153mount...]
      java.lang.ClassNotFoundException: wicket153mount///
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:242)
      at org.apache.wicket.application.AbstractClassResolver.resolveClass(AbstractClassResolver.java:108)
      at org.apache.wicket.util.lang.WicketObjects.resolveClass(WicketObjects.java:68)
      at org.apache.wicket.request.mapper.AbstractComponentMapper.getPageClass(AbstractComponentMapper.java:138)
      at org.apache.wicket.request.mapper.PackageMapper.parseRequest(PackageMapper.java:142)
      at org.apache.wicket.request.mapper.AbstractBookmarkableMapper.mapRequest(AbstractBookmarkableMapper.java:263)
      at org.apache.wicket.request.mapper.mount.UnmountedMapperAdapter.mapRequest(UnmountedMapperAdapter.java:73)
      at org.apache.wicket.request.mapper.mount.MountMapper.mapRequest(MountMapper.java:131)
      at org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:130)
      at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:595)

      1. WICKET-4303WithWicket6.0_120111.zip
        5.37 MB
        Masaya Seko
      2. WICKET-4303WithWicket6.0.zip
        5.37 MB
        Masaya Seko
      3. ASF.LICENSE.NOT.GRANTED--screenshot-1.jpg
        38 kB
        Masaya Seko
      4. wicket153mount.zip
        33 kB
        Masaya Seko

        Activity

        Hide
        Masaya Seko added a comment -

        Multiplied by the nuisance.
        My skills were insufficient.

        Thanks to Peter and Martin .

        I am waiting for the Wicket 1.5.4.

        Show
        Masaya Seko added a comment - Multiplied by the nuisance. My skills were insufficient. Thanks to Peter and Martin . I am waiting for the Wicket 1.5.4.
        Hide
        Martin Grigorov added a comment - - edited

        The new attachment works OK with current 6.0-SNAPSHOT.
        I'm not sure what is "wicket-core-6.0-mybuild.jar" but maybe you broke it in your build.
        Use https://repository.apache.org/content/repositories/snapshots/ to get the latest 6.0-SNAPSHOT.

        Show
        Martin Grigorov added a comment - - edited The new attachment works OK with current 6.0-SNAPSHOT. I'm not sure what is "wicket-core-6.0-mybuild.jar" but maybe you broke it in your build. Use https://repository.apache.org/content/repositories/snapshots/ to get the latest 6.0-SNAPSHOT.
        Hide
        Masaya Seko added a comment - - edited

        attach quickstart.
        WICKET-4303WithWicket6.0_120111.zip

        Show
        Masaya Seko added a comment - - edited attach quickstart. WICKET-4303 WithWicket6.0_120111.zip
        Hide
        Masaya Seko added a comment - - edited

        I'm sorry.

        OS: Windows XP SP3
        Browser: IE8, Firefox9.0.1, Chrome 16.0.912.75

        Quick Start is attached to the comments below.
        quickstart can be run in Eclipse WTP.

        Built using the jar from the master branch from git.

        I also prepared a quick start deployment server.
        Can be tested at the following URL.
        http://176.34.56.245/wicket60_niceurl/

        According to my friend, the problem does not occur in Safari on MacOS.
        Except Safari (for example, Firefox9) you want to try it.

        Show
        Masaya Seko added a comment - - edited I'm sorry. OS: Windows XP SP3 Browser: IE8, Firefox9.0.1, Chrome 16.0.912.75 Quick Start is attached to the comments below. quickstart can be run in Eclipse WTP. Built using the jar from the master branch from git. I also prepared a quick start deployment server. Can be tested at the following URL. http://176.34.56.245/wicket60_niceurl/ According to my friend, the problem does not occur in Safari on MacOS. Except Safari (for example, Firefox9) you want to try it.
        Hide
        Peter Ertl added a comment -

        unfortunately your description is hard to read and not very detailed

        I tried to reproduce the issue on OS X with no success. Please do the following:

        • attach an updated quickstart (or specify which one you used)
        • what operating system(s) and browser(s) did cause the issue
        • assure that you work with the current master branch from git
        Show
        Peter Ertl added a comment - unfortunately your description is hard to read and not very detailed I tried to reproduce the issue on OS X with no success. Please do the following: attach an updated quickstart (or specify which one you used) what operating system(s) and browser(s) did cause the issue assure that you work with the current master branch from git
        Hide
        Masaya Seko added a comment -

        @Peter
        Thanks for patiently examined.

        In my environment, returned by the destination URL is wrong Wicket.
        Responses are shown below.


        HTTP/1.1 302 Moved Temporarily
        Server: Apache-Coyote/1.1
        Date: Mon, 09 Jan 2012 06:02:25 GMT
        Expires: Thu, 01 Jan 1970 00:00:00 GMT
        Pragma: no-cache
        Cache-Control: no-cache, no-store
        Location: http://192.168.0.131:8080/wicket60_niceurl/../wicket/page?1
        Content-Length: 0


        As a result, the transition to the following URL. And that 404.
        http://192.168.0.131:8080/wicket/page?1

        After 404, if I manually enter the following URL appears the page I were expecting.
        http://192.168.0.131:8080/wicket60_niceurl/wicket/page?1
        Thus, the rendering of the page buffer is seemed to have been successful.

        This issue occurs in IE8. Does not occur in Safari 5.1.2.

        If you need any additional information, please tell me.

        Show
        Masaya Seko added a comment - @Peter Thanks for patiently examined. In my environment, returned by the destination URL is wrong Wicket. Responses are shown below. HTTP/1.1 302 Moved Temporarily Server: Apache-Coyote/1.1 Date: Mon, 09 Jan 2012 06:02:25 GMT Expires: Thu, 01 Jan 1970 00:00:00 GMT Pragma: no-cache Cache-Control: no-cache, no-store Location: http://192.168.0.131:8080/wicket60_niceurl/../wicket/page?1 Content-Length: 0 As a result, the transition to the following URL. And that 404. http://192.168.0.131:8080/wicket/page?1 After 404, if I manually enter the following URL appears the page I were expecting. http://192.168.0.131:8080/wicket60_niceurl/wicket/page?1 Thus, the rendering of the page buffer is seemed to have been successful. This issue occurs in IE8. Does not occur in Safari 5.1.2. If you need any additional information, please tell me.
        Hide
        Peter Ertl added a comment -

        fix appled for 1.5 as well...

        @Masaya: is the problem still there with current wicket-6 build? I could reproduce the problem you had in my local workspace and got it solved, too. So if you still have a problem it's maybe of a different kind. Please provide more information in that case.

        Show
        Peter Ertl added a comment - fix appled for 1.5 as well... @Masaya: is the problem still there with current wicket-6 build? I could reproduce the problem you had in my local workspace and got it solved, too. So if you still have a problem it's maybe of a different kind. Please provide more information in that case.
        Hide
        Peter Ertl added a comment -

        @Martin: It can be applied to 1.5 (I even ran my first successful 'git cherry-pick' on my local repo - just first want to make sure the fix is appropriate.

        Show
        Peter Ertl added a comment - @Martin: It can be applied to 1.5 (I even ran my first successful 'git cherry-pick' on my local repo - just first want to make sure the fix is appropriate.
        Hide
        Martin Grigorov added a comment -

        @Peter: can this fix be ported to 1.5 ?

        Show
        Martin Grigorov added a comment - @Peter: can this fix be ported to 1.5 ?
        Hide
        Masaya Seko added a comment -

        thank you for the URL.
        But, in my environment seems to not work FIX.
        I tested with IE8.

        I also built its own Wicket 6.0 jar, did not work.

        Attach a project in Eclipse 3.5 WTP that I used for testing.
        It has its own jar file contains.

        Show
        Masaya Seko added a comment - thank you for the URL. But, in my environment seems to not work FIX. I tested with IE8. I also built its own Wicket 6.0 jar, did not work. Attach a project in Eclipse 3.5 WTP that I used for testing. It has its own jar file contains.
        Show
        Peter Ertl added a comment - I use this one: https://repository.apache.org/content/groups/snapshots/org/apache/wicket/wicket-core/6.0-SNAPSHOT/
        Hide
        Masaya Seko added a comment - - edited

        I wanted to try and test in Wicket 6.0.
        However, do not know how to obtain build results 6.0-SNAPSHOT.

        https://repository.apache.org/content/repositories/snapshots/org/apache/wicket/wicket-core/6.0-SNAPSHOT/
        This URL is likely a result of old building.

        I've never built a Wicket 6.0.

        I tested with Wicket6.0 takes time.

        Sorry, but I need time.
        A few days later, I think the results say.

        Show
        Masaya Seko added a comment - - edited I wanted to try and test in Wicket 6.0. However, do not know how to obtain build results 6.0-SNAPSHOT. https://repository.apache.org/content/repositories/snapshots/org/apache/wicket/wicket-core/6.0-SNAPSHOT/ This URL is likely a result of old building. I've never built a Wicket 6.0. I tested with Wicket6.0 takes time. Sorry, but I need time. A few days later, I think the results say.
        Hide
        Masaya Seko added a comment -

        404 error screenshot.

        Show
        Masaya Seko added a comment - 404 error screenshot.
        Hide
        Masaya Seko added a comment -

        ClassNotFoundException is not throw.
        but 404 errors occur.

        I was tested in Wicket1.5.3.
        May I failed to apply the fix Wicket1.5.3 Peter I's.

        I check again later.

        If the following fails.

        public class WicketApplication extends WebApplication
        {
        @Override
        public Class<HomePage> getHomePage()

        { return HomePage.class; }

        @Override
        public void init()

        { super.init(); mountPackage("/base", getHomePage()); }

        }

        Show
        Masaya Seko added a comment - ClassNotFoundException is not throw. but 404 errors occur. I was tested in Wicket1.5.3. May I failed to apply the fix Wicket1.5.3 Peter I's. I check again later. If the following fails. public class WicketApplication extends WebApplication { @Override public Class<HomePage> getHomePage() { return HomePage.class; } @Override public void init() { super.init(); mountPackage("/base", getHomePage()); } }
        Hide
        Peter Ertl added a comment - - edited

        @masaya:

        • do you still get a 404 when clicking on the link?
        • why you need to call #setUrl() ? Request#getUrl() builds the url from the current request. Setting the url doesn't make much sense unless you run a test case.
        Show
        Peter Ertl added a comment - - edited @masaya: do you still get a 404 when clicking on the link? why you need to call #setUrl() ? Request#getUrl() builds the url from the current request. Setting the url doesn't make much sense unless you run a test case.
        Hide
        Masaya Seko added a comment -

        Thanks to commit the fix.
        I read a fix.
        I am not familiar with Wicket 6.0. If I say the wrong thing, sorry.

        I seem to need to call the Request#setUrl() in HomePageMapper#parseRequest()
        (Unfortunately, Request#setUrl has not been defined.)

        If you don't call Request#setUrl(), I seem to be ignored in the value MountedMapper#parseRequest() rewritten by Url#canonical().

        Show
        Masaya Seko added a comment - Thanks to commit the fix. I read a fix. I am not familiar with Wicket 6.0. If I say the wrong thing, sorry. I seem to need to call the Request#setUrl() in HomePageMapper#parseRequest() (Unfortunately, Request#setUrl has not been defined.) If you don't call Request#setUrl(), I seem to be ignored in the value MountedMapper#parseRequest() rewritten by Url#canonical().
        Hide
        Peter Ertl added a comment -

        I committed an initial fix ... the quickstart works for me now ... however I am a little scared that the problem exists in several other places

        @masaya: please verify the fix

        Show
        Peter Ertl added a comment - I committed an initial fix ... the quickstart works for me now ... however I am a little scared that the problem exists in several other places @masaya: please verify the fix
        Hide
        Masaya Seko added a comment -

        I understood the issue.
        I'm not in a hurry. I Waiting for a fix.

        And, thank you to modify the title of ticket.

        Show
        Masaya Seko added a comment - I understood the issue. I'm not in a hurry. I Waiting for a fix. And, thank you to modify the title of ticket.
        Hide
        Peter Ertl added a comment -

        the broken url that gets generated is

        /example/..;jsessionid=4390380538049583490

        which tries to map to the home page. due to the jsessionid the browser does not shorten the url into '/'

        so this only happens when a new session is created.

        The fix is probably to enforce the generation of

        /example/HomePage;jsessionid=4390380538049583490

        but I still have to get the whole picture (in my scarce spare time to apply a fix...

        Show
        Peter Ertl added a comment - the broken url that gets generated is /example/..;jsessionid=4390380538049583490 which tries to map to the home page. due to the jsessionid the browser does not shorten the url into '/' so this only happens when a new session is created. The fix is probably to enforce the generation of /example/HomePage;jsessionid=4390380538049583490 but I still have to get the whole picture (in my scarce spare time to apply a fix...
        Hide
        Peter Ertl added a comment - - edited

        I can confirm this broken behavior on 6.0-SNAPSHOT...

        The problem only happens when the home page resides in the package that you map with mountPackage(..). Moving the home page outside of the mounted package (so it will by default be mapped to '/') will eliminate the problem. However this is just a workaround for this bug and I am still investigating on the internals of how to fix this.

        Show
        Peter Ertl added a comment - - edited I can confirm this broken behavior on 6.0-SNAPSHOT... The problem only happens when the home page resides in the package that you map with mountPackage(..). Moving the home page outside of the mounted package (so it will by default be mapped to '/') will eliminate the problem. However this is just a workaround for this bug and I am still investigating on the internals of how to fix this.
        Hide
        Masaya Seko added a comment -

        Tested using Wicket 1.5.x head.
        Change the results by the browser.
        (Any browser, not. Sorry)

        The following are the test results.
        Chrome 16.0 : Failure to Transition
        Firefox 3.6.13 : Successful Transition
        Firefox 9.0 : Failure to Transition
        IE 6 : Failure to Transition
        IE 8 : Failure to Transition
        Safari 5.1.2 : Successful Transition

        Show
        Masaya Seko added a comment - Tested using Wicket 1.5.x head. Change the results by the browser. (Any browser, not. Sorry) The following are the test results. Chrome 16.0 : Failure to Transition Firefox 3.6.13 : Successful Transition Firefox 9.0 : Failure to Transition IE 6 : Failure to Transition IE 8 : Failure to Transition Safari 5.1.2 : Successful Transition
        Hide
        Sven Meier added a comment -

        Works fine here with Firefox. Could you please retry with wicket-1.5.x head?

        Show
        Sven Meier added a comment - Works fine here with Firefox. Could you please retry with wicket-1.5.x head?
        Hide
        Masaya Seko added a comment -

        Attach quickstart.

        Show
        Masaya Seko added a comment - Attach quickstart.

          People

          • Assignee:
            Peter Ertl
            Reporter:
            Masaya Seko
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development