Re: Error message I can't figure out
"Roedy Green" <see_website@mindprod.com.invalid> wrote in message
news:nbs8o513huanmtsgsjs7dks39o3ukfaimu@4ax.com...
On Tue, 23 Feb 2010 13:28:55 -0500, Tim Slattery <Slattery_T@bls.gov>
wrote, quoted or indirectly quoted someone who said :
nested exception is:
java.io.NotSerializableException: java.util.TreeMap$Values
I am storing a TreeMap object in the session object, but the
description of TreeMap says that it implements the Serializable
interface. So why am I getting this error?
see
http://mindprod.com/jgloss/runerrormessages.html#NOTSERIALIAZABLEEXCEPTION
Not only does TreeMap have to be serializable, but also the keys and
objects you store in it, and the objects those objects point to etc.
values refers to the Collection inside TreeMap of the values ( the
things you look up by key), in other words your objects.
TreeMap$Values is an inner class, the type of the object returned from
TreeMap.values(). It's not used for anything else. In particular, it's not
involved when serializing a TreeMap. It's also not serializable. The only
way to get this error is to attempt to serialize the return from
TreeMap.values(). This will always fail, regardless of the types of the
objects in the map; in fact, it will fail even if the map is empty.