title: Changing request to view scope results in java.io.NotSerializableException: javax.faces.model.ListDataModel
body: <p>I get the below error, when setting the scope for the managedBean as ViewScoped.  Below is the exception Im getting when trying to invoke the page </p>
  
  <pre><code>javax.faces.FacesException: java.io.NotSerializableException: javax.faces.model.ListDataModel  
  at com.sun.faces.renderkit.ResponseStateManagerImpl.getViewState(ResponseStateManagerImpl.java:137)  
  at javax.faces.application.StateManager.getViewState(StateManager.java:555)  
  at com.sun.faces.context.PartialViewContextImpl.renderState(PartialViewContextImpl.java:416)  
  at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:300)  
  at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)  
  at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981)  
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)  
  at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390)  
  at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)  
  at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)  
  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)  
  at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)  
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)  
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)  
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)  
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)  
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)  
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)  
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)  
  at java.lang.Thread.run(Unknown Source)  
  Caused by: java.io.NotSerializableException: javax.faces.model.ListDataModel  
  at java.io.ObjectOutputStream.writeObject0(Unknown Source)  
  
  
  
  Sep 26, 2012 4:01:13 PM org.apache.catalina.core.StandardWrapperValve invoke  
  SEVERE: Servlet.service() for servlet Faces Servlet threw exception  
  java.lang.IllegalStateException: CDATA tags may not nest  
  at         com.sun.faces.renderkit.html_basic.HtmlResponseWriter.startCDATA(HtmlResponseWriter.java:630)  
  at javax.faces.context.ResponseWriterWrapper.startCDATA(ResponseWriterWrapper.java:172)  
  at javax.faces.context.PartialResponseWriter.startError(PartialResponseWriter.java:342)  
  at org.primefaces.context.PrimePartialResponseWriter.startError(PrimePartialResponseWriter.java:210)  
  at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:200)  
  at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:123)  
  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)  
  </code></pre>
  
  <p>Any pointers or help on resolving the issue is much appericiated.  Thanks in Advance. </p>