Wicket
  1. Wicket
  2. WICKET-5084

ClassNotFoundException with Atmosphere on Bookmarkable pages

    Details

      Description

      https://github.com/krasa/wicket-atmosphere-quickstart

      run, go to second page, click on link.

      from some reason, it makes requests to

      http://localhost:8080/wicket/bookmarkable/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-ver-1362607904693.js
      instead of: http://localhost:8080/wicket/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-ver-1362607904693.js
      =>java.lang.ClassNotFoundException: page

      I noticed few things:
      1) Form cannot be updated, crashes on NPE
      2) ugly crash when updated component has not setOutputMarkupId(true);
      3) otherwise it seems to work

        Issue Links

          Activity

          Hide
          Emond Papegaaij added a comment -

          Both issues (Atmosphere 1002 and WICKET-4997) have been fixed. Therefore, I'm closing this issue.

          Show
          Emond Papegaaij added a comment - Both issues (Atmosphere 1002 and WICKET-4997 ) have been fixed. Therefore, I'm closing this issue.
          Hide
          Vojtěch Krása added a comment -

          proper link: https://github.com/Atmosphere/atmosphere/issues/1002

          I am not sure about previous problems, but when I try to render bookmarkable link to some page which is not mounted, and I am on the same page(or maybe other bookmarkable not mounted page), then the link will point to /wicket/bookmarkable/bookmarkable/com.example.Page

          • wicket-atmosphere-0.13
          Show
          Vojtěch Krása added a comment - proper link: https://github.com/Atmosphere/atmosphere/issues/1002 I am not sure about previous problems, but when I try to render bookmarkable link to some page which is not mounted, and I am on the same page(or maybe other bookmarkable not mounted page), then the link will point to /wicket/bookmarkable/bookmarkable/com.example.Page wicket-atmosphere-0.13
          Hide
          Hendy Irawan added a comment -

          atmosphere issue #1002 in github: https://issues.apache.org/jira/browse/WICKET-5084
          since it occurs on atmosphere 1.0.10, 1.0.11, and 1.0.12

          Show
          Hendy Irawan added a comment - atmosphere issue #1002 in github: https://issues.apache.org/jira/browse/WICKET-5084 since it occurs on atmosphere 1.0.10, 1.0.11, and 1.0.12
          Hide
          Andrei Badea added a comment -

          Would it be a stupid idea for the broadcast rendering to set up an AtmosphereWebRequest whose clientUrl is the clientUrl of the page as it looked like when EventBus.register() was called?

          Show
          Andrei Badea added a comment - Would it be a stupid idea for the broadcast rendering to set up an AtmosphereWebRequest whose clientUrl is the clientUrl of the page as it looked like when EventBus.register() was called?
          Hide
          Vojtěch Krása added a comment -

          Thanks, as a workaround I use older version, mounted the page to defined path and do not update Forms directly.

          Show
          Vojtěch Krása added a comment - Thanks, as a workaround I use older version, mounted the page to defined path and do not update Forms directly.
          Hide
          Andrei Badea added a comment -

          I have just been hit by another manifestation of this: when a BookmarkablePageLink is rendered for a broadcast, the URL looks like ./bookmarkable/com.example.Page. The browser processes this in the context of the URL in the location bar, which is .../wicket/bookmarkable/com.example.Page, so clicking the link results in a CNFE.

          The link uses Component.urlFor(Class<C>, PageParameters), which does not try to use BookmarkableListenerInterfaceRequestHandler.

          Show
          Andrei Badea added a comment - I have just been hit by another manifestation of this: when a BookmarkablePageLink is rendered for a broadcast, the URL looks like ./bookmarkable/com.example.Page. The browser processes this in the context of the URL in the location bar, which is .../wicket/bookmarkable/com.example.Page, so clicking the link results in a CNFE. The link uses Component.urlFor(Class<C>, PageParameters), which does not try to use BookmarkableListenerInterfaceRequestHandler.
          Hide
          Emond Papegaaij added a comment -

          I've opened a ticket in the Atmosphere bugtracker
          https://github.com/Atmosphere/atmosphere/issues/949

          Show
          Emond Papegaaij added a comment - I've opened a ticket in the Atmosphere bugtracker https://github.com/Atmosphere/atmosphere/issues/949
          Hide
          Emond Papegaaij added a comment -

          The problem is that components are rendered in the context of the websocket connection, which always is to a page instance (like wicket/page?5). This is because the AtmosphereBehavior is stateful. Now, if the page is at wicket/bookmarkable/my.Page, urls will be rendered relative to wicket/page?5, which obviously is wrong. Component.urlFor uses BookmarkableListenerInterfaceRequestHandler only if the page is stateless, which is never the case for Atmosphere. Unfortunately, I don't know if there's any way to fix this.

          The NPE in form rendering is caused by Atmosphere returning null from encodeURL. I'll open a ticket for that, because that seems wrong to me.

          Show
          Emond Papegaaij added a comment - The problem is that components are rendered in the context of the websocket connection, which always is to a page instance (like wicket/page?5). This is because the AtmosphereBehavior is stateful. Now, if the page is at wicket/bookmarkable/my.Page, urls will be rendered relative to wicket/page?5, which obviously is wrong. Component.urlFor uses BookmarkableListenerInterfaceRequestHandler only if the page is stateless, which is never the case for Atmosphere. Unfortunately, I don't know if there's any way to fix this. The NPE in form rendering is caused by Atmosphere returning null from encodeURL. I'll open a ticket for that, because that seems wrong to me.

            People

            • Assignee:
              Emond Papegaaij
              Reporter:
              Vojtěch Krása
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development