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


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

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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM