0

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.

Community
  • 1
  • 1
Rob N
  • 15,024
  • 17
  • 92
  • 165

1 Answers1

0

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.

Community
  • 1
  • 1
Jason482
  • 197
  • 1
  • 10
  • I don't think this is it. The `User` class is already available, in the same package as `LoginService` class, which is definitely getting picked up, because that service is getting called. Also, this error is occurring server side, not client side. – Rob N Feb 28 '12 at 04:32
  • You seem to be talking about run-time, is the source available at compile-time, though? That means its path needs to be listed as a source path in your "discussions" gwt.xml file, and it must be made available using whatever mechanism you are using to build the discussions module. – Jason482 Feb 28 '12 at 13:38
  • The short answer is yes, it's available at compile time. I'm running in devmode so it get's a bit different, but the common module is in Discussions.gwt.xml as an `inherits` element. And then the Common.gwt.xml has the right path as a source path. Then this same source path is added to the class path of the usual `ant devmode` target. This has been working for weeks. What changed was I moved the server-side implementation of the service. – Rob N Feb 28 '12 at 17:21
  • This may be happening only in devmode. Updated the question. I need to work on better reproducing it. – Rob N Feb 28 '12 at 19:56