報錯 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