> I have a 'not serializable error' on sessions in a srevr cluster
> problem
> (the clustered servers are sharing session data and whinge that some
> of it cannot be serialized, - I have to solve this problem somehow)
[...]
> Is there a common list somewhere or some overriding simple principle
> that
> would tell me that something is probably not serializable?
Sure. If it's a Java object, then it's probably not Serializable.
Really. Serializability is the exception, not the rule.
More practically, no object can be serialized (via Java's built-in
mechanism) unless its class implements the Serializable interface.
Being an instance of such a class is not a sufficient condition,
however: for an object to be successfully serialized, it must also be
true that all non-transient references it holds must be null or refer to
serializable objects. (Do note that that is a recursive condition.)
Primitive values, nulls, and transient variables aren't a problem.
Static variables do not belong to individual objects, so they don't
present a problem either.
Some common classes are reliably serialization-safe. Strings are
probably most notable here, but all the wrapper classes for primitive
types are also safe. Arrays of primitives are reliably serializable.
Arrays of reference types can be serialized if all their elements can be
serialized.

Signature
John Bollinger
jobollin@indiana.edu
The index of the Java Developers Almanac shows you the classes that
implement Serializable. You could also write a program to scan the
documentation files for 'implements Serializable' and then some.
billreyn@gmail.com - 19 Feb 2006 11:27 GMT
Thanks for the info about serializable objects, I
am going to scan my error log now to find out
just which session data objects never made it
across the network on my app server.
I hope that this non-serializable session data
(in a cluster) is not important and I can 'transient'
it.