This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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: 13026
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?
It's not a secret anymore!