Notserializableexception or Writeabortedexception
Run the SSH project under Tomcat, start, open a page (let the session work), stop, and start again, it is possible to report an error similar to the following:
Org.apache.catalina.session.StandardManager Doload
Critical: IOException while loading persisted sessions:java.io.WriteAbortedException:writing aborted; Java.io.NotSerializableException:xxxxxxxx
Java.io.WriteAbortedException:writing aborted; Java.io.NotSerializableException:xxxxxxxx
Org.apache.catalina.session.StandardManager start
Severity: Exception loading sessions from persistent storage
Java.io.WriteAbortedException:writing aborted; Java.io.NotSerializableException:xxxxxxx
The reason is that when Tomcat stops, it saves the session resource and then tries to resume the session after restarting the service.
Solution One:
Configure Tomcat to not save session resources when it is closed.
In the context of Server.xml, add the following content:
<manager classname= "Org.apache.catalina.session.PersistentManager" saveonrestart= "false"/>
Start stop and other operations, such as the following similar error:
Org.apache.catalina.session.PersistentManagerBase start
Severity: No Store configured, persistence disabled
The reason is adding a little bit less stuff.
Workaround:
Modify the <Context> in <Manager> element that you just added:
Will
<manager classname= "Org.apache.catalina.session.PersistentManager" saveonrestart= "false"/>
Switch
<manager classname= "Org.apache.catalina.session.PersistentManager" saveonrestart= "false" >
<store classname= "Org.apache.catalina.session.FileStore"/>
</Manager>
To resolve the issue.
Solution Two:
Serialize the classes that need to be placed in the session.
That is, let the class implement interface java.io.Serializable can.
Tomcat boot Java.io.NotSerializableException or writeabortedexception error resolution