iteye_7290 2011-08-10 17:01
浏览 470
已采纳

java.io.NotSerializableException: java.util.RandomAccessSubList

 

16:47:03,522 ERROR [STDERR] java.io.NotSerializableException: java.util.RandomAccessSubList

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)

16:47:03,522 ERROR [STDERR]  at java.util.ArrayList.writeObject(ArrayList.java:570)

16:47:03,522 ERROR [STDERR]  at sun.reflect.GeneratedMethodAccessor392.invoke(Unknown Source)

16:47:03,522 ERROR [STDERR]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

16:47:03,522 ERROR [STDERR]  at java.lang.reflect.Method.invoke(Method.java:597)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)

16:47:03,522 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)

16:47:03,538 ERROR [STDERR]  at java.util.ArrayList.writeObject(ArrayList.java:570)

16:47:03,538 ERROR [STDERR]  at sun.reflect.GeneratedMethodAccessor392.invoke(Unknown Source)

16:47:03,538 ERROR [STDERR]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

16:47:03,538 ERROR [STDERR]  at java.lang.reflect.Method.invoke(Method.java:597)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)

16:47:03,538 ERROR [STDERR]  at java.util.ArrayList.writeObject(ArrayList.java:570)

16:47:03,538 ERROR [STDERR]  at sun.reflect.GeneratedMethodAccessor392.invoke(Unknown Source)

16:47:03,538 ERROR [STDERR]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

16:47:03,538 ERROR [STDERR]  at java.lang.reflect.Method.invoke(Method.java:597)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)

16:47:03,538 ERROR [STDERR]  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.application.AjaxStateHolder.saveState(AjaxStateHolder.java:277)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.application.AjaxStateManager.saveStateInSession(AjaxStateManager.java:523)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.application.AjaxStateManager.buildViewState(AjaxStateManager.java:503)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.application.AjaxStateManager.saveView(AjaxStateManager.java:462)

16:47:03,538 ERROR [STDERR]  at org.apache.myfaces.tomahawk.application.jsp.JspTilesTwoViewHandlerImpl.renderTilesView(JspTilesTwoViewHandlerImpl.java:309)

16:47:03,538 ERROR [STDERR]  at org.apache.myfaces.tomahawk.application.jsp.JspTilesTwoViewHandlerImpl.renderView(JspTilesTwoViewHandlerImpl.java:241)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)

16:47:03,538 ERROR [STDERR]  at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)

16:47:03,538 ERROR [STDERR]  at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)

16:47:03,538 ERROR [STDERR]  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:182)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

16:47:03,538 ERROR [STDERR]  at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:285)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:295)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:373)

16:47:03,538 ERROR [STDERR]  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:500)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

16:47:03,538 ERROR [STDERR]  at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

16:47:03,538 ERROR [STDERR]  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

16:47:03,538 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

16:47:03,538 ERROR [STDERR]  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

16:47:03,538 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

16:47:03,538 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

16:47:03,538 ERROR [STDERR]  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

16:47:03,538 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

16:47:03,538 ERROR [STDERR]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

16:47:03,538 ERROR [STDERR]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

16:47:03,538 ERROR [STDERR]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

16:47:03,538 ERROR [STDERR]  at java.lang.Thread.run(Thread.java:619)


说是RandomAccessSubList没有序列化,网上没找到解决方法。



  • 写回答

8条回答 默认 最新

  • suziwen 2011-08-10 21:58
    关注

    [quote]java.util.List接口中方法:
    List subList(int fromIndex,int toIndex)
    参数:fromIndex - subList 的低端(包括)toIndex - subList 的高端(不包括)
    此接口返回的是原List的部分元素视图,返回视图的elementData会包含原List所有元素数据。
    元素类型是java.util.RandomAccessSubList,此类型没有实现序列化接口,Rmi直接传输此视图将报错:
    java.rmi.MarshalException: error marshalling return; nested exception is:
    java.io.NotSerializableException: java.util.RandomAccessSubList。
    转换到ArrayList就可以序列化远程传输:ArrayList.addAll(list.subList());[/quote]

    还有,你的对像需要实现序列化接口
    就是像这样的
    public class test1 implements Serializable

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(7条)

报告相同问题?

悬赏问题

  • ¥15 MATLAB代码补全插值
  • ¥15 Typegoose 中如何使用 arrayFilters 筛选并更新深度嵌套的子文档数组信息
  • ¥15 前后端分离的学习疑问?
  • ¥15 stata实证代码答疑
  • ¥50 husky+jaco2实现在gazebo与rviz中联合仿真
  • ¥15 dpabi预处理报错:Error using y_ExtractROISignal (line 251)
  • ¥15 在虚拟机中配置flume,无法将slave1节点的文件采集到master节点中
  • ¥15 husky+kinova jaco2 仿真
  • ¥15 zigbee终端设备入网失败
  • ¥15 金融监管系统怎么对7+4机构进行监管的