I have a perfectly working GWT application. Now I'm trying to use gwt-syncproxy to create an Android client that can simply reuse server-side code.
So far, everything has worked perfectly. The only problem I can find is when I run RPC for a method that expects an enumeration as a parameter.
Renaming looks something like this:
import java.io.Serializable; import com.google.gwt.user.client.rpc.IsSerializable; public enum ReferenceTable implements IsSerializable, Serializable { basetable, othertable; ReferenceTable(){} }
The error message I get is:
com.google.gwt.user.client.rcp.IncompatibleRemoteServiceException: Invalid type signature for package.ReferenceTable
which suggests that this is a serialization issue.
I tried using different combinations of IsSerializable and Serializable and always deleted the project before deployment. Both the GWT application and the Android application use the same code for the data types used for communication.
Does anyone have any ideas how to solve this? If nothing works, I could refrain from using enums, but I would prefer to use them. Moreover, everything works for the very connection between the server and the GWT client.
BTW: Server side error:
Caused by: com.google.gwt.user.client.rpc.SerializationException: Invalid type signature for some.package.ReferenceTable at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.validateTypeVersions(ServerSerializationStreamReader.java:1116) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:610) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readObject(ServerSerializationStreamReader.java:567) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader$ValueReader$8.readValue(ServerSerializationStreamReader.java:140) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:425) at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:312) ... 24 more
EDIT
I created an example GWT application and an example application for Android, so people can really try the code:
To deploy the application, simply modify the build.properties file and then run build.xml as an ant script. In the MainActivity the Android application, change the URL to point to the GWT application.