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{

	//...
}

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

6 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
billbaroud
9 years ago

thank dude

Fabian
5 years ago

this is not working

tavita
6 years ago

no me soluciono nada

SomeOne
12 years ago

Thank you man!! You saved my life!!

Chris
12 years ago

Thank you man.

Rampage
15 years ago

Thank you!