Wicket
  1. Wicket
  2. WICKET-1773

DiskPageStore-FileNotFoundException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.4
    • Fix Version/s: 1.3.5
    • Component/s: wicket
    • Labels:
      None

      Description

      With the current 1.3-Snapshot, I encounter problems with DiskPageStore:

      --8<--
      09:30:43.151 ERROR [.wicket.protocol.http.pagestore.DiskPageStore] - Error flushing page
      java.lang.RuntimeException: java.io.FileNotFoundException: /usr/local/www/services/local.silberlicht.de/html/WEB-INF/tmp/Silberlicht-filestore/abcgm_hyTIaiqgnqDNmUr/pm-null (No such file or directory)
      at org.apache.wicket.protocol.http.pagestore.FileChannelPool.newFileChannel(FileChannelPool.java:104)
      at org.apache.wicket.protocol.http.pagestore.FileChannelPool.getFileChannel(FileChannelPool.java:171)
      at org.apache.wicket.protocol.http.pagestore.DiskPageStore$SessionEntry.savePage(DiskPageStore.java:241)
      at org.apache.wicket.protocol.http.pagestore.DiskPageStore.flushPagesToSaveList(DiskPageStore.java:891)
      at org.apache.wicket.protocol.http.pagestore.DiskPageStore$PageSavingThread.run(DiskPageStore.java:961)
      at java.lang.Thread.run(Thread.java:613)
      Caused by: java.io.FileNotFoundException: /usr/local/www/services/local.silberlicht.de/html/WEB-INF/tmp/Silberlicht-filestore/abcgm_hyTIaiqgnqDNmUr/pm-null (No such file or directory)
      at java.io.RandomAccessFile.open(Native Method)
      at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
      at org.apache.wicket.protocol.http.pagestore.FileChannelPool.newFileChannel(FileChannelPool.java:99)
      ... 5 common frames omitted
      --8<--

      The path /usr/local/www/services/local.silberlicht.de/html/WEB-INF/tmp/Silberlicht-filestore/ actually exists and has the proper rights - so creation of temporary directories/files should be possible (actually, the directory was created by the wicket app).

        Activity

        Hide
        Jan Kriesten added a comment -

        Behavior is reproducable when sessions are invalidated not within wicket but e.g. Spring Security.

        It turns out that DiskPageStore#unbind calls flushPagesToSaveList() which again tries to write to the no longer existing SessionStore.

        Just clearing the list of pages instead of trying to write them solves the problem:

        --8<--
        public void unbind(String sessionId)
        {
        SessionEntry entry = (SessionEntry)sessionIdToEntryMap.remove(sessionId);
        if (entry != null)
        {
        if (isSynchronous())

        { entry.unbind(); }

        else

        { List pages = getPagesToSaveList(sessionId); if( pages!=null ) pages.clear(); entry.unbind(); pagesToSaveAll.remove(sessionId); }

        }
        }
        --8<--

        Show
        Jan Kriesten added a comment - Behavior is reproducable when sessions are invalidated not within wicket but e.g. Spring Security. It turns out that DiskPageStore#unbind calls flushPagesToSaveList() which again tries to write to the no longer existing SessionStore. Just clearing the list of pages instead of trying to write them solves the problem: -- 8< -- public void unbind(String sessionId) { SessionEntry entry = (SessionEntry)sessionIdToEntryMap.remove(sessionId); if (entry != null) { if (isSynchronous()) { entry.unbind(); } else { List pages = getPagesToSaveList(sessionId); if( pages!=null ) pages.clear(); entry.unbind(); pagesToSaveAll.remove(sessionId); } } } -- 8< --
        Hide
        Bruno Borges added a comment -

        If there's no reason to write pages from an invalid session, I think that is the correct behavior to just clear the list.

        Any other thought ?

        Show
        Bruno Borges added a comment - If there's no reason to write pages from an invalid session, I think that is the correct behavior to just clear the list. Any other thought ?
        Hide
        Matej Knopp added a comment -

        I think that's the proper behavior too. Committed change for 1.3 branch and trunk

        Show
        Matej Knopp added a comment - I think that's the proper behavior too. Committed change for 1.3 branch and trunk

          People

          • Assignee:
            Matej Knopp
            Reporter:
            Jan Kriesten
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development