Thats funny. As a parameter or return type i also get an exception.
Nested in another object it works (with the given strange (bug)
behaviour), for example:

public class DTOTest implements Serializable {

  public String stringField;
  public Class<String> clazz = String.class;

}

public interface DTOTestService extends RemoteService{

  public DTOTest execute( DTOTest dtotest );

}

I am also wondering why Class shouldn't be serializable? It implements
Serializable. Indeed it has a private constructor, but since GWT 1.5
this shouldn't be a problem:
"As of GWT 1.5, it must have a default (zero argument) constructor
(with any access modifier) or no constructor at all. "

Regards
Maerch

On 16 Feb., 18:55, jossey <joss...@gmail.com> wrote:
> Hi,
> I just tried having a Class field in my dto and having a Class arg in
> my service.
> It did not work for me.
> It says Type java.lang.Class is not serializable.
>
> I wonder how it is working for you with errors.
> I m also using GWT 1.5.3.
>
> On Feb 16, 1:02 pm, Maerch <marcin.skirzyn...@googlemail.com> wrote:
>
> > Heyja,
>
> > i am trying to serialize an object with a field of the type 'class'.
> > Something like this:
>
> > public Class<?> clazz;
>
> > I get no exception or something else. But when i set another field,
> > for example a String, in this object, and send it to the server, the
> > String field will become null, i.e. i am losing the value of this
> > field during the serialization/deserialization process.
>
> > Can anyone confirm this behaviour and tell me, if this a an expectable
> > behaviour and why.
>
> > I am using Windows Vista 64 and GWT 1.5.3
>
> > Thanks
> > Maerch
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to