I get an error sometimes when I deployed project, but does not it every time. Localbean does not work when the error
error message
Warning: JSF1063: WARNING! Setting non-serializable attribute value into HttpSession (key: localBean, value class: LocalBean).
Localbean
package com.mycompany.crm;
import java.io.Serializable;
import java.util.Locale;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
@ManagedBean
@SessionScoped
public class LocalBean implements Serializable{
public Locale locale;
@PostConstruct
public void init() {
locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
}
public Locale getLocale() {
return locale;
}
public String getLanguage() {
return locale.getLanguage();
}
public void setLanguage(String language) {
locale = new Locale(language);
FacesContext.getCurrentInstance().getViewRoot().setLocale(locale);
}
}
try placing a serialVersionUID field in your class like: