Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
9.0.0
-
None
Description
If you have a Wicket application with the default DefaultPageManagerProvider (which sets a chain of PageStores) and with the storesettings "encrypted" and "asynchronous" on true (so your chain contains the AsynchronousPageStore and the CryptingPageStore), you get a WicketRuntimeException on the asynchronous pagestore thread upon the first page load.
This is because the asynchronous thread has no session, which the CryptingPageStore requires, leading to an exception (stacktrace below).
A working test is somewhat difficult to achieve without mocking everything to simulate this behaviour (because the default mocked wicket stuff such as MockPageContext avoid this bug) but it should be enough to just add
getStoreSettings().setAsynchronous(true).setEncrypted(true);
to the init of a default wicket application that has the DefaultPageManagerProvider.
This might not be easy to solve and therefore an unsupported configuration but given that you can create it by simply setting two properties to true, without any indication that it is wrong, it seems like a configuration bug at the least.
Stacktrace:
2020-08-05 21:02:39,303 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) Exception in thread "Wicket-AsyncPageStore-PageSavingThread" org.apache.wicket.WicketRuntimeException: There is no application attached to current thread Wicket-AsyncPageStore-PageSavingThread 2020-08-05 21:02:39,303 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) at deployment.keyhub-web-console.war//org.apache.wicket.Application.get(Application.java:213) 2020-08-05 21:02:39,304 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) at deployment.keyhub-web-console.war//org.apache.wicket.Session.get(Session.java:181) 2020-08-05 21:02:39,304 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) at deployment.keyhub-web-console.war//org.apache.wicket.pageStore.DefaultPageContext.getSessionData(DefaultPageContext.java:74) 2020-08-05 21:02:39,304 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) at deployment.keyhub-web-console.war//org.apache.wicket.pageStore.AsynchronousPageStore$PendingAdd.getSessionData(AsynchronousPageStore.java:214) 2020-08-05 21:02:39,304 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) at deployment.keyhub-web-console.war//org.apache.wicket.pageStore.CryptingPageStore.getSessionData(CryptingPageStore.java:90) 2020-08-05 21:02:39,304 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) at deployment.keyhub-web-console.war//org.apache.wicket.pageStore.CryptingPageStore.addPage(CryptingPageStore.java:135) 2020-08-05 21:02:39,304 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) at deployment.keyhub-web-console.war//org.apache.wicket.pageStore.SerializingPageStore.addPage(SerializingPageStore.java:82) 2020-08-05 21:02:39,304 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) at deployment.keyhub-web-console.war//org.apache.wicket.pageStore.AsynchronousPageStore$PageAddingRunnable.run(AsynchronousPageStore.java:278) 2020-08-05 21:02:39,304 ERROR [stderr] (Wicket-AsyncPageStore-PageSavingThread) at java.base/java.lang.Thread.run(Thread.java:832)