Iacopo
unread,Sep 10, 2011, 3:02:35 PM9/10/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
Hi everyone,
i'm building an university project with GWT + AppEngine.
In my RPC implementation (in /rpc) i have the following method:
public String subscribeToService(SubscriptionData userData);
which is then implemented and declared in the Async interface.
The SubscriptionData is a class defined in /server/data which handles
the entity to be saved together with all its properties.
Its code is the following:
import com.google.appengine.api.datastore.Entity;
import com.google.gwt.user.client.rpc.IsSerializable;
public class SubscriptionData implements IsSerializable {
private String hashedEmailAddress;
private String nickname;
private String role;
private Entity storableData;
public void setRole(String role) {
//storableData.setProperty("role", role);
}
public String getRole() {
return role;
}
public String getEmailAddress() {
return hashedEmailAddress;
}
public void setEmailAddress(String emailAddress) {
this.hashedEmailAddress = emailAddress;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Entity getEntity() {
return storableData;
}
}
I checked the RPC doc page and, if i got it right, "A user-defined
class is serializable if all of the following apply:
It is assignable to IsSerializable or Serializable, either because it
directly implements one of these interfaces or because it derives from
a superclass that does
All non-final, non-transient instance fields are themselves
serializable, and
As of GWT 1.5, it must have a default (zero argument) constructor
(with any access modifier) or no constructor at all."
My class has all of them (Entity implements isSerializable), but still
when i try and compile the code i get the following error:
[ERROR] Errors in 'file:'project position'/rpc/RpcServiceAsync.java'
[ERROR] Line 26: No source code is available for type
'project name'.server.data.SubscriptionData; did you forget to inherit
a required module?
where in line 26 i have the following:
public void subscribeToService(SubscriptionData userData,
AsyncCallback<String> callback);
What do i do wrong? Can i use my custom serializable class as a
parameter in an RPC call?
Thanks everyone!
Cheers
Iacopo