Tomcat boot Java.io.NotSerializableException or writeabortedexception error resolution

Source: Internet
Author: User
Tags sessions

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.