您的位置:首页 > 其它

报错 setAttribute: Non-serializable attribute解决方法

2016-04-12 15:27 330 查看
家校通项目部署在阿里云后,登陆报错。查看日记发现错误:

[ERROR] 2016-04-12 14:51:49 setAttribute: Non-serializable attribute userInfoSessionCacheKey
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute userInfoSessionCacheKey


该类没序列化的原因,百度了一下发现是分布式部署的时候需要序列化

原先是

public class UserInfoCache {

/** 经办人员个人资源Session缓存key */
public static final String USER_INFO_SESSION_CACHE_KEY = "userInfoSessionCacheKey";


变成

public class UserInfoCache implements java.io.Serializable{

private static final long serialVersionUID = 1L;

/** 经办人员个人资源Session缓存key */
public static final String USER_INFO_SESSION_CACHE_KEY = "userInfoSessionCacheKey";


  ok!

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: