Description
Sometimes when I return to my website after some period I see the following exception:
java.lang.NullPointerException at org.apache.wicket.page.PageStoreManager$SessionEntry.clear(PageStoreManager.java:365) at org.apache.wicket.page.PageStoreManager$SessionEntry.valueUnbound(PageStoreManager.java:353) at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1784) at org.apache.catalina.session.StandardSession.expire(StandardSession.java:856) at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:659) at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:573) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:558) at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5496) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1351) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1355) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1355) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1333)
This is very hard to investigate what is the reason for this bug from my side because I do not have a stable reproducer , but I believe one of the following 1-line fixes in Wicket
- Adding a null check for sessionCache before using it
- Making sessionCache field never null
can resolve this problem.