I have a rather involved, but hopefully not unique, serialization question.

I have a basic type that also has a more detailed subtype.  So, to keep it 
simple, say I have:

    package client;
    class Type implements Serializable {
        String name;
    }

And a subtype:

    package server;
    class Subtype extends Type {
        File source;
    }

Basically, while on the server I care about the details of the subtype but 
when in the client I only care about the basic items.  What I'd like to do 
is create a service:

    interface TypeService extends RemoteService {
        public Type getType();
    }

And in the implementation do something like this:

    class TypeServiceImpl extends RemoteServiceServlet implements TypeService 
{
        public Type getType() {
            return (Type) (new Subtype(file, name));
        }
    }

But when I try to do this I get an error thrown that looks like this:

    com.google.gwt.user.client.rpc.SerializationException: Type 
'server.Subtype' was not included in the set of types which can be 
serialized by this SerializationPolicy or its Class object could not be 
loaded. For security purposes, this type will not be serialized.: instance 
= "Subtype".

How do I get it to serialize the (static) Type and not the (runtime) 
Subtype?

Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to