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

SecondLevelCache + DiskPageStore Serialization issue with Anonymous inner classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4-RC2
    • None
    • wicket
    • None
    • Solaris/JDK6u10 Jetty clustered session store.

    Description

      It seems like declaring an anonymous inner class will hold on to the previous page which will break serialization with secondlevelcache in a clustered environment.

      I have run into an odd issue with serialization which throws a stackoverflow exception. Here is the cause:

      Passing an LDM model as-is to a page, it will stackoverflow on the receiving page, if that page is refreshed twice or a form has been submitted.

      Here is an example...

      setResponsePage(new EditBlogPage(new LoadableDetachableModel<Blog>() {
      private static final long serialVersionUID = 1L;
      @Override
      protected Blog load()

      { // just an example.... return new Blog(); }

      }));

      However, if I subclass the LDM and pass it like so, it will work just fine.

      public class FakeLDM extends LoadableDetachableModel<Blog> {
      private static final long serialVersionUID = 1L;

      @Override
      protected Blog load()

      { return new Blog(); }

      }

      setResponsePage(new EditBlogPage(new FakeLDM()));

      One last thing, If I construct the LDM inside the receiving page. It will work fine as well.

      This seems to only happen with the SecondLevelCache, any ideas?

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            victori Victor Igumnov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: