---
title: " IOException while loading persisted sessions: java.io.WriteAbortedException: wr"
author: "smartan"
date: "2012-05-29T17:11:41Z"
tags: []
categories: ["企业架构"]
slug: "ioexception-while-loading-persisted-sessions-java-io-writeabortedexception-wr"
draft: false
lastmod: "2012-05-29T17:11:41Z"
id: 1544110
url: "https://smartan.iteye.com/blog/1544110"
---

```java
 IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.ancong.entity.Phone
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.ancong.entity.Phone
```


我运行程序的时候会出现上面的那个异常（偶尔，有时候没有），但是程序也能运行起来， 
有时候关闭程序的时候也会出现异常（是什么没注意）， 
想知道这是什么引起的，怎么样解决· 
PetsVO 是com.pethospital.VO包里的一个JavaBean类，里面只有属性和get，set方法
------解决方法--------------------------------------------------------
com.pethospital.VO.PetsVO没有 implements java.io.Serializable 
------解决方法--------------------------------------------------------
你要把一个对象当做流写出去,必须要让这个对象 implements java.io.Serializable
java.io.Serializable这个接口里面并没有任何方法要你实现的,这只是一个标记接口 
表示实现了这个接口的对话都是可串行化的