Hello I'm using a ViewScoped Bean the Problem is that when call it I get the NotSerializableException.
This is the code of my Managed Bean :
@ManagedBean(name="demandesBean")
@ViewScoped
public class DemandesBean implements Serializable {
private static final long serialVersionUID = 1L;
@ManagedProperty(value="#{demandeService}")
private DemandeService demandeService; //A Spring Service
@ManagedProperty(value="#{loginBean}")
private LoginBean loginBean;
private DemandeVO newDemande;
@PostConstruct
public void initData() {
newDemande = new DemandeVO();
}
public void doAjouterDemande(ActionListener event) {
demandeService.createDemande(newDemande, loginBean.getUsername());
newDemande = new DemandeVO();
}
public List<DemandeVO> getListDemande() {
return demandeService.getAllDemandesByUser(loginBean.getUsername());
}
public DemandeService getDemandeService() {
return demandeService;
}
public void setDemandeService(DemandeService demandeService) {
this.demandeService = demandeService;
}
public LoginBean getLoginBean() {
return loginBean;
}
public void setLoginBean(LoginBean loginBean) {
this.loginBean = loginBean;
}
public DemandeVO getNewDemande() {
return newDemande;
}
public void setNewDemande(DemandeVO newDemande) {
this.newDemande = newDemande;
}
}
I Recieve The following Exception :
GRAVE: Exiting serializeView - Could not serialize state: com.bull.congesJBPM.serviceImpl.DemandeServiceImpl
java.io.NotSerializableException: com.bull.congesJBPM.serviceImpl.DemandeServiceImpl
Any fix for this problem ?? Please Help !