Open oniseijin opened 9 years ago
Figured it out: in GWT: http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/server/rpc/RemoteServiceServlet.java?r=5045
the file is opened with InputStream is = getServletContext().getResourceAsStream( serializationPolicyFilePath);
The path on the server would be /js/gwt/explorer/954B65F9DE429170F90997B93C81F349.gwt.rpc, for it to work seamlessly, but the path passed in from the server side has /static in front of it, so definetly conflicts with resources plugin (url is different from absolute location from a resource perspective). Would need to either not use the resources plugin, or provide some custom implementation of RemoteServicesServlet, or something else in the chain.
So, this explains why it won't work as a war file, perhaps something similar in hosted/code server mode.
This would solve the war problem, but not account for the failure in dev mode...
Fix for run-app: ensure codeserver is running and set property in BuildConfig.groovy
(does anyone know a better place to do this, maybe plugin specific? _Events.groovy under compile didn't work)
System.setProperty("gwt.codeserver.port", "9876")
Fix for war deployment: in an extension of RemoteServiceServlet [Bit of a hack, but it works for this problem, would need something more generic, perhaps detecting some property, or the location of /static in the url)
@Override
protected SerializationPolicy doGetSerializationPolicy(
HttpServletRequest request, String moduleBaseURL, String strongName) {
moduleBaseURL = moduleBaseURL.replace("/static", "");
return super.doGetSerializationPolicy(request, moduleBaseURL, strongName);
}
Any suggestions on the best way to do either of the above in the most generic way?
Not sure if this is a grails problem, a plugin problem, or a problem in my head, but for the life of me I cannot get RPC working with Java RPC and GWT in grails.
Caused by SerializationException: Type 'com.sencha.gxt.data.shared.loader.PagingLoadConfigBean' [This is seralizable though, and working in their example]
This happens with 1.0.3 (earlier) and the 2.0-SNAPSHOT that @donbeave made. This makes me wonder if it's possible (and what magic was presumably done to get it working as a Grails Service). The base project is the GXT 3.1.1 Explorer.
To me, it looks like something in the resources plugin gets in the way of finding the url.
After a week, need some input to see what could be interfering. Refreshing caches does not work.