I've decided to split my client server gwt project into 3 separate mvn projects:
the shared component contains all the model classes, Service interfaces, and ServiceAsync interfaces. This project is declared as dependency for both server and client gwt projects. Everything compiles fine, and the client application runs correctly. The client also makes the correct rpc request, but server responds with:
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException/3936916533","Type name elision in RPC payloads is only supported if the RPC whitelist file is used."
What can the problem be? should I configure something differently in my servlet implementation?
It means that for whatever reason, your *.gwt.rpc
files could not be loaded (i.e. they're either not present or perhaps not accessible through their expected URL). This probably means that you've got their location wrong after the split.
The error your receive is only present in a class called com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy
which gets loaded if something happens with the regular policy files.
From the javadoc:
A serialization policy compatible with GWT 1.3.3 RPC. This is used when no serialization policy file is present.
In the same class, we have:
private static final String ELISION_ERROR = "Type name elision in RPC "
+ "payloads is only supported if the RPC whitelist file is used.";
...and also stuff like:
/**
* Implemented to fail with a useful error message.
*/
public final String getClassNameForTypeId(String id)
throws SerializationException {
throw new SerializationException(ELISION_ERROR);
}
So it looks like this is deliberate, although the error message is ironically not very useful.
You can run a debugger through RemoteServiceServlet#loadSerializationPolicy
and see why its not loading the policy files you expect it to.