use loadabledetachablemodel and it should load a list of your unserialiable entities that will poupulate your listview
On Mon, Mar 5, 2012 at 3:39 PM, Behrooz Nobakht <nob...@gmail.com> wrote: > Hello, > > I'm using a ListView<*S*> in which S is not "serializable" but it is not > either kept in the page data structure. So, every time the page is > rendered, I fetch a list of *S* and then construct the ListView. Even in > this point, I am not really sure if this assumption is correct but I am > assuming that since no data is kept at the page component level, so there > is not need for *S* to be serializable. However, I get the following > exception in which *T extends S*: > > 2012-03-05 10:48:55,002 ERROR [http-8080-6] Error serializing object class > com.my.MyPage [object=[Page class = com.my.MyPage, id = 7, render count = > 1]] (JavaSerializer.java:94) > org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: > Unable to serialize class: com.my.T > Field hierarchy is: > 7 [class=com.my.MyPage, path=7] > private java.lang.Object org.apache.wicket.MarkupContainer.children > [class=[Ljava.lang.Object;] > java.lang.Object org.apache.wicket.Component.data[9] > [class=com.my.MyPage$MyListView, path=7:serviceInstances] > java.lang.Object org.apache.wicket.Component.data > [class=org.apache.wicket.model.util.WildcardListModel] > private java.lang.Object > org.apache.wicket.model.util.GenericBaseModel.object > [class=java.util.ArrayList] > private java.lang.Object > org.apache.wicket.model.util.GenericBaseModel.object[write:1] [class=* > com.my.T*] *<----- field that is not serializable* > at > org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:386) > at > org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:365) > at > org.apache.wicket.util.io.SerializableChecker.access$500(SerializableChecker.java:65) > at > org.apache.wicket.util.io.SerializableChecker$1InterceptingObjectOutputStream.replaceObject(SerializableChecker.java:525) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1140) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) > at java.util.ArrayList.writeObject(ArrayList.java:710) > at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) > at > java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962) > at > java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480) > at > java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) > at > org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:532) > at > org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:365) > at > org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:646) > at > org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:569) > at > org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:365) > at > org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:646) > at > org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:569) > at > org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:365) > at > org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:431) > at > org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:365) > at > org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:646) > at > org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:569) > at > org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:365) > at > org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:715) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342) > at > org.apache.wicket.serialize.java.JavaSerializer$CheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:258) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342) > at > org.apache.wicket.serialize.java.JavaSerializer.serialize(JavaSerializer.java:77) > at > org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:368) > at > org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:146) > at > org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:383) > at > org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:171) > at > org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:94) > at > org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68) > at > org.apache.wicket.page.PageAccessSynchronizer$2.commitRequest(PageAccessSynchronizer.java:281) > at org.apache.wicket.Application$2.onDetach(Application.java:1598) > at > org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:99) > at > org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:97) > at > org.apache.wicket.util.listener.ListenerCollection$1.notify(ListenerCollection.java:119) > at > org.apache.wicket.util.listener.ListenerCollection.reversedNotify(ListenerCollection.java:143) > at > org.apache.wicket.util.listener.ListenerCollection.reversedNotifyIgnoringExceptions(ListenerCollection.java:113) > at > org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:95) > at > org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:600) > at > org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:539) > at > org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:287) > at > org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162) > at > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218) > at > com.fredhopper.controller.dashboard.DashboardApplicationFilter.doFilter(DashboardApplicationFilter.java:51) > 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:293) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) > at > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) > at java.lang.Thread.run(Thread.java:722) > Caused by: java.io.NotSerializableException: com.my.T > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) > at java.util.ArrayList.writeObject(ArrayList.java:710) > at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) > at > java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962) > at > java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480) > at > java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) > at > java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528) > at > java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493) > at > java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) > at > java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528) > at > java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493) > at > java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) > at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170) > at > java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528) > at > java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493) > at > java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) > at > org.apache.wicket.serialize.java.JavaSerializer$CheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:250) > ... 34 more > > As far as I've tracked down the problem, the class WildCardListModel > assumes that in the method createSerializableVersionOf it can create a > serializable version of a List of T which is not correct. In general this > is harmless for my application. Now, my question is that if there is a way > to configure Wicket to suppress this exception? Or, what is the best way to > deal with this issue? > > As a side note, I cannot make neither S nor T serializable at this moment. > > Thank you in advance, > Behrooz Nobakht -- thank you, regards, Vineet Semwal --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org