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

it2022-05-09  36

家校通项目部署在阿里云后,登陆报错。查看日记发现错误:

[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!

 

转载于:https://www.cnblogs.com/yudaxian/p/5382881.html


最新回复(0)