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

在要求不分页打印所有符合要求的记录时(需要避开offseam的分页框架)

而直接使用protected ListDataModel dataModel; 并填装

运行报如下错误

 

2009-9-4 8:41:01 com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/private/order/printTransferOrder.xhtml]
java.io.NotSerializableException: javax.faces.model.ListDataModel
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
    at com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:244)
    at javax.faces.render.ResponseStateManager.writeState(ResponseStateManager.java:155)
    at org.ajax4jsf.application.AjaxStateManager.writeState(AjaxStateManager.java:294)
    at org.ajax4jsf.application.AjaxStateManager.writeState(AjaxStateManager.java:256)
    at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:606)
    at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
    at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.offseam.Filter.doFilter(Filter.java:166)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.dz.web.filter.ValidateFiler.doFilter(ValidateFiler.java:56)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    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(Thread.java:595)

 

 

解决方法 自定义类继承javax.faces.model.ListDataModel并实现Serializable

你可能感兴趣的:(java,apache,thread,tomcat,sun)