WARNING: JSF1063: WARNING! Setting non-serializable attribute value into HttpSession

Problem

In JSF 2.0 web application, during server initialization, it hits following warning message

WARNING: JSF1063: WARNING! Setting non-serializable attribute value into HttpSession
(key: user, value class: com.mkyong.UserBean).

UserBean.java


package com.mkyong;

@ManagedBean(name="user")
@SessionScoped
public class UserBean{

	//...
}

Solution

The “UserBean” is not serializable. To get rid of this warning message, just make this bean implement java.io.Serializable interface.

UserBean.java


package com.mkyong;

import java.io.Serializable;

@ManagedBean(name="user")
@SessionScoped
public class UserBean implements Serializable{

	//...
}

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

avatar
5 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
4 Comment authors
billbaroudSomeOneChrisJSF 2.0 TutorialRampage Recent comment authors
newest oldest most voted
billbaroud
Guest
billbaroud

thank dude

SomeOne
Guest
SomeOne

Thank you man!! You saved my life!!

Chris
Guest
Chris

Thank you man.

trackback
JSF 2.0 Tutorial

[…] WARNING: JSF1063: WARNING! Setting non-serializable attribute value into HttpSession […]

Rampage
Guest
Rampage

Thank you!