Model Package Location + Serialization?

7 views
Skip to first unread message

Shaun Wallace

unread,
Apr 10, 2013, 3:01:26 PM4/10/13
to pir...@googlegroups.com
Hi I am currently building a project with GWTP and Piriti to use JSON Mapping on my models.

GWTP Action -> ActionHandler -> Class calls Rest service -> Sends JSON result back to ActionHandler -> ActionHandler passes it onto Model
    CLIENT              SERVER                    SERVER                                     SERVER                                     SHARED

For a simple test I am using the basic class from: https://github.com/hpehl/piriti

Where do I take my JSON result and pass it to the model for Serialization?


ERROR:

Type 'com.icerm.shared.dispatch.GetUserResult' 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.icerm.shared.dispatch.GetUserResult@6411a006

My Class for GetUserResult that is in the shared package:

public class GetUserResult implements Result {

VirtualUserBundle vub = new VirtualUserBundle();

private String firstName;


@SuppressWarnings("unused")

private GetUserResult() {

// For serialization only

String jsonString = "{ \"readonly\": true, \"name\": \"Foo\", \"createdAt\": \"08.01.2010\", \"count\": 20 }";

vub = VirtualUserBundle.JSON.read(jsonString);

}


public GetUserResult(String firstName) {

this.firstName = firstName;

}


public String getFirstName() {

return firstName;

}

}



shaun_...@icerm.brown.edu

unread,
Apr 11, 2013, 1:24:51 PM4/11/13
to pir...@googlegroups.com
Just needed to rewrite class declaration:
public class VirtualUserBundle implements Serializable {
Reply all
Reply to author
Forward
0 new messages