Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8595397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:25:24+00:00 2026-06-12T00:25:24+00:00

I get the below error, when setting the scope for the managedBean as ViewScoped.

  • 0

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

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)  

Any pointers or help on resolving the issue is much appericiated. Thanks in Advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:25:25+00:00Added an answer on June 12, 2026 at 12:25 am

    java.io.NotSerializableException: javax.faces.model.ListDataModel

    Your view scoped bean has apparently a ListDataModel property. This is indeed not serializable as its state is per definition dependent on the current HTTP request (which is usually not to be saved/shared anywhere –which would in turn require serialization).

    A view scoped bean spans across multiple HTTP requests and is by an unique key stored the HTTP session. Some but not all servletcontainers stores sessions on harddisk instead of on memory and this requires all Java objects which are (in)directly stored in the session to implement Serializable, including view scoped beans and all of its properties.

    You can fix this particular issue in 2 ways:

    1. Mark the property transient, get hold of the wrapped list as another property, and use lazy loading in the getter.

      private transient DataModel<Foo> model;
      private List<Foo> list;
      
      public DataModel<Foo> getModel() {
          if (model == null) {
              model = new ListDataModel<Foo>(list);
          }
          return model;
      }
      
    2. Don’t use DataModel, but use an alternative instead. A common requirement for having DataModel was in JSF 1.x being able to obtain the current row. But since EL 2.2, you could just pass that as method argument. See also How can I pass selected row to commandLink inside dataTable?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the error below when trying to run an executable jar file. The
I have a website that I get the below error on whenever I navigate
I run mvn install in command line and get stuck by below error. Caused
I get the error below when I try to execute a task with celery
I will get the error below randomly when I'm running an asp.net application I
I get the error shown below (73TypeError) on a small background animation script when
I get an error on line 14 of the below: using System; using System.Collections.Generic;
I get this error when I run the code below. I have normally used
I get the following error with the code below. expected constructor, destructor, or type
I get the following error in the query below: #1064 - You have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.