title: Tomcat - Prevent persistence of sessions
body: <p>I get an IOException while restarting tomcat.
  I tried various solutions as suggested in <a href="https://stackoverflow.com/questions/20622746/exception-loading-sessions-from-persistent-storage">exception loading sessions from persistent storage</a></p>
  
  <p>None of them solve the problem.
  I tried uncommenting the <code>&lt;Manager pathname=""/&gt;</code> in the context.xml. Didn't help.</p>
  
  <p>Another solution suggested is to make the class implement Serialiable. I don't want to do that. </p>
  
  <p>My aim is to make Tomcat not persist these sessions. 
  I'm using Tomcat 7.0.54.</p>
  
  <p>The following is the stack trace. Please help.</p>
  
  <pre><code>`SEVERE: IOException while loading persisted sessions:
       java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException:     com.comp.cloud.portal.zCompHD
       java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.comp.cloud.portal.zCompHD
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
       at java.util.LinkedList.readObject(LinkedList.java:1136)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:606)
       at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
       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 java.util.HashMap.readObject(HashMap.java:1183)
       at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:606)
       at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
       at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1619)
       at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1084)
       at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:282)
       at org.apache.catalina.session.StandardManager.load(StandardManager.java:202)
       at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:489)
       at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
       at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5476)
       at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
       at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
       at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
       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:744)
  </code></pre>