I see several undefined objects:

result
requestFormModel
it

If these are defined at the class level, they must be serializable.

If you have Logging set at Info, Wicket will give you the actual field that
is not serializable, although from the error it looks like something to do
with AbstractList

Iterator objects are not serializable.  I would look at how you are defining
the "it" variable.



On Mon, Sep 28, 2009 at 7:25 AM, Charles Moulliard <cmoulli...@gmail.com>wrote:

> Hi,
>
> I would like to know what is the best way to work with the method
> iterator of DataProvider.
>
> I have created a class implementing IDataProvider. Depending of a
> parameter, the DAO service called is not the same inside in the
> iterator method. For some DAO services, a list is returned but for one
> service, an object is returned instead of a list.
>
> If I try to create a ArrayList inside the iterator, the following
> error is generated :
>
>
> org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
> Unable to serialize class: java.util.AbstractList$Itr
> Field hierarchy is:
>  0 [class=com.xpectis.x3s.fundbox.web.RequestPage, path=0]
>    private java.lang.Object
> org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
>      java.lang.Object org.apache.wicket.Component.data[3]
> [class=com.xpectis.x3s.fundbox.web.RequestPage$1, path=0:requestList]
>        private final
> org.apache.wicket.markup.repeater.data.IDataProvider
> org.apache.wicket.markup.repeater.data.DataViewBase.dataProvider
> [class=com.xpectis.x3s.fundbox.web.data.RequestProvider]
>          private java.util.Iterator
> com.xpectis.x3s.fundbox.web.data.RequestProvider.it
> [class=java.util.AbstractList$Itr] <----- field that is not
> serializable
>        at
> org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
>
> How can I avoid this issue ?
>
> Here is my code :
>
> public class RequestProvider implements IDataProvider {
>
> ...
>
>        public Iterator iterator(int first, int count) {
>
>                result = new ArrayList<PlatformDTO>();
>
>                if (requestFormModel != null) {
>
>                        if (requestFormModel.getId() != null) {
>                                request =
> requestService.getRequest(requestFormModel.getId());
>                                result.add(request);
>                                it = result.iterator();
>
>                        } else if (requestFormModel.getFileName() != null) {
>                                it =
> requestService.findRequestByFileName(requestFormModel.getFileName()).iterator();
>
>                        }
>
> Regards,
>
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to