File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Serializing Iterators? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Serializing Iterators?" Watch "Serializing Iterators?" New topic

Serializing Iterators?

Nick Head

Joined: May 10, 2002
Posts: 2
Just got this error message from my client code:
No Serializer found to serialize 'java.util.Iterator'
I noticed that Iterator is not one of the datatypes that has a built-in serializer. So does anyone have any good ideas of how to do this?
Hopefully it won't involve having to write a custom serializer...
[ May 10, 2002: Message edited by: Nick Head ]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
There is a good reason - Iterator is an interface. You need to redesign your application so it doesn't try to serialize an Iterator. Maybe send an array or a Vector?
Nick Head

Joined: May 10, 2002
Posts: 2
thanks for that
I was trying to use a BeanSerializer, and as it is out of the question to modify the application, looks like I'll have to write a custom serializer after all.
[ May 12, 2002: Message edited by: Nick Head ]
I agree. Here's the link:
subject: Serializing Iterators?
jQuery in Action, 3rd edition