You need to mark the field of type MessageContext as transient so that the serialization mechanism doesn't attempt to serialize it. This only works if the state of the MessageContext has no significance whatsoever to the newly reconstituted SoapPair object. If it does, then you have to manually write out the state of the MessageContext object for which you will have to provide an implementation for readObject and writeObject methods for your SoapPair class.
But given that if the MessageContext class isn't Serializable , there might be a good reason behind it. Are you sure the MessageContext instance *really* constitutes the state of your SoapPair object? Also given that any context logically belongs to a given environment, serializing it or clubbing it with something which is meant to be serialized doesn't make much sense.
Last edited by ~s.o.s~; Dec 17th, 2008 at 9:47 am.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
Offline 8,871 posts
since Jun 2006