GWT serialization issue

Posted by Eddy on Stack Overflow See other posts from Stack Overflow or by Eddy
Published on 2010-05-19T02:00:07Z Indexed on 2010/05/20 1:00 UTC
Read the original article Hit count: 374

Filed under:
|

I am having a heck of a time returning an ArrayList of objects that implement IsSerializable via RPC. The IsSerializable pojo contains one variable, a String, and has a 0 parameter constructor. I have removed the .gwt.rpc file from my war and still I get:

com.google.gwt.user.client.rpc.SerializationException: Type 'com.test.myApp.client.model.Test' 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 = com.test.myApp.client.model.Test@17a9692
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:610)

I am using GWT 2.0.2 with jdk 1.6.0_18.

Any ideas on what might be going on or what I am doing wrong?

Here is the code for the Test class and the remote method is returning ArrayList. I even modified the code for it to just return one instance of Test with the same result: the exception above.

package com.test.myApp.client.model;

import com.google.gwt.user.client.rpc.IsSerializable;

public class Test implements IsSerializable{
    private String s;

    public Test() {}

    public Test(String s) {
        this.s = s;
    }

    public String getS() {
        return s;
    }

    public void setS(String s) {
        this.s = s;
    }
}

Greatly appreciate the help! Eddy

© Stack Overflow or respective owner

Related posts about gwt

Related posts about serialization