0
votes

I have several GWT modules and web apps running in Jetty. They each want to use my LoginService RPC interface, so I put this interface and its servlet implementation in a common module. I serve the servlet (LoginServiceImpl) from my root web context, and web.xml exposes it at the url "/loginService". In a another GWT module, to use this service, I had to set the entry point, like this...

 LoginServiceAsync loginService = GWT.create(LoginService.class);
 ServiceDefTarget t = (ServiceDefTarget)loginService;
 t.setServiceEntryPoint("/loginService");

Now, the module trying to use the loginService is called discussions, and I get this error on the server.

ERROR: The serialization policy file  
'/discussions/discussions/7B344C69AD493C1EC707EC98FE148AA0.gwt.rpc' was not found; 
did you forget to include it in this deployment?

So the servlet is reporting an error that mentions the client (the discussions module). I'm guessing that the RPC plumbing passed the name of this .rpc file through from the client, and the servlet is now looking for it. (?) As an experiment, I copied, the *.gwt.rpc files from the discussions module into the root web context, so the servlet could find them. This did stop the error. But I still get another error:

com.google.gwt.user.client.rpc.SerializationException: Type      
'mystuff.web.shared.User' was not assignable to 
'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field  
serializer. For security purposes, this type will not be serialized.: ...

This class is serializable; it worked before in other modules, so now I'm lost.

What is the right way to use the LoginService from multiple clients modules?

Update:

This error was showing up in hosted devmode, and it went away after a full compile. Maybe this is related to gwt serialization policy hosted mode out of sync . I will update again if I can better reproduce the problem.

1

1 Answers

0
votes

See my answer here. The short answer is: you'll need to make mystuff.web.shared.Users source available at compile-time to your discussions module.