title: Exception loading sessions from persistent storage, extended
body: <p>I get</p>
  
  <pre><code>Aug 25, 2017 3:35:42 PM org.apache.catalina.session.StandardManager startInternal
  SCHWERWIEGEND: Exception loading sessions from persistent storage
  java.lang.ClassCastException: java.lang.String cannot be cast to java.io.ObjectStreamClass
          at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1511)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
          at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1997)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1921)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
          at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1608)
          at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1074)
          at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:259)
          at org.apache.catalina.session.StandardManager.load(StandardManager.java:176)
          at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:465)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
          at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5593)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
          at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
          at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>((HttpSession) getContextProperty("Session")).setAttribute(name, value);
  </code></pre>
  
  <p>throws</p>
  
  <pre><code>Fri Aug 25 15:35:47 GMT+01:00 2017
  Server Exception. ID: 72acb94e_15e19d20417_12
  java.lang.NullPointerException
          at de.supportgis.gdi.gdigui.GDIApplication.setSessionAttribute(GDIApplication.java:187)
          at de.supportgis.gdi.gdigui.GDIApplication.setCurrentUserLocale(GDIApplication.java:156)
          at de.supportgis.gdi.gdigui.components.StandardContentPanel.getLS(StandardContentPanel.java:236)
          at de.supportgis.gdi.gdigui.content.Login.&lt;init&gt;(Login.java:68)
          at de.supportgis.gdi.gdigui.GDIApplication.init(GDIApplication.java:62)
          at nextapp.echo.app.ApplicationInstance.doInit(ApplicationInstance.java:288)
          at nextapp.echo.webcontainer.UserInstance.prepareApplicationInstance(UserInstance.java:484)
          at nextapp.echo.webcontainer.ComponentInputProcessor.process(ComponentInputProcessor.java:160)
          at nextapp.echo.webcontainer.ClientMessage.process(ClientMessage.java:194)
          at nextapp.echo.webcontainer.InputProcessor.process(InputProcessor.java:163)
          at nextapp.echo.webcontainer.Synchronization.process(Synchronization.java:121)
          at nextapp.echo.webcontainer.service.SynchronizeService.service(SynchronizeService.java:78)
          at nextapp.echo.webcontainer.WebContainerServlet.process(WebContainerServlet.java:432)
          at de.supportgis.gdi.gdigui.StartServlet.process(StartServlet.java:37)
          at nextapp.echo.webcontainer.WebContainerServlet.doPost(WebContainerServlet.java:316)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>I guess this is no duplicate, because I checked and applied every answer in <a href="https://stackoverflow.com/questions/20622746/exception-loading-sessions-from-persistent-storage">exception loading sessions from persistent storage</a> with no luck, for example:</p>
  
  <ul>
  <li>Delete /var/cache/tomcat7/Catalina/localhost/gdi/SESSIONS.ser (which is non-existent anyway if Tomcat is stopped).</li>
  </ul>
  
  <hr>
  
  <p>I have no broken symlinks:</p>
  
  <pre><code>find / -xtype l 2&gt;/dev/null
  </code></pre>
  
  <p>returns nothing relevant.</p>
  
  <hr>
  
  <p>I guess it is a file system rights problem coming from an <code>apt dist-upgrade</code>. Do I really have to reinstall the hole server?</p>