I want to turn off serialization in my Wicket app and store all page/session information in RAM. My application has a very small number of users (generally 1); I do not need a cluster deployment; and I need to cache some non-serializable data between requests.
Is there a way so that Wicket will not automatically attempt to serialize my pages / session? I tried the suggestion to use use HttpSessionDataStore at https://cwiki.apache.org/confluence/display/WICKET/Page+Storage, but it had no effect. I still get stack traces like this:
SEVERE: Error serializing object class com.prosc.safetynet.Administer [object=[Page class = com.prosc.safetynet.Administer, id = 0, render count = 1]]
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.prosc.safetynet.SafetyNetSession$1
Field hierarchy is:
0 [class=com.prosc.safetynet.Administer, path=0]
java.lang.Object org.apache.wicket.Component.data [class=org.apache.wicket.model.CompoundPropertyModel]
private java.lang.Object org.apache.wicket.model.CompoundPropertyModel.target [class=com.prosc.safetynet.SafetyNetSession$2]
final com.prosc.safetynet.SafetyNetSession com.prosc.safetynet.SafetyNetSession$2.this$0 [class=com.prosc.safetynet.SafetyNetSession]
private java.lang.Object com.prosc.safetynet.SafetyNetSession.tryAndSerializeMeBitch [class=com.prosc.safetynet.SafetyNetSession$1] <----- field that is not serializable
at org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:395)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:374)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:655)
at org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:578)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:374)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:655)
at org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:578)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:374)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:655)
at org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:578)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:374)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:655)
at org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:578)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:374)
at org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:724)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at org.apache.wicket.serialize.java.JavaSerializer$CheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:258)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at org.apache.wicket.serialize.java.JavaSerializer.serialize(JavaSerializer.java:77)
at org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:368)
at org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:146)
at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:383)
at org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:171)
at org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:94)
at org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68)
at org.apache.wicket.page.PageAccessSynchronizer$2.commitRequest(PageAccessSynchronizer.java:281)
at org.apache.wicket.Application$2.onDetach(Application.java:1598)
at org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:99)
at org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:97)
at org.apache.wicket.util.listener.ListenerCollection$1.notify(ListenerCollection.java:119)
at org.apache.wicket.util.listener.ListenerCollection.reversedNotify(ListenerCollection.java:143)
at org.apache.wicket.util.listener.ListenerCollection.reversedNotifyIgnoringExceptions(ListenerCollection.java:113)
at org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:95)
at org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:603)
at org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:542)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:287)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:680)