On Tuesday, June 3, 2014 1:27:21 PM UTC+2, Ali wrote:
I have a code server running at http://localhost:9876/, and I have a web server running at http://localhost:8081/.If I load the nocache.js file from the web server (http://localhost:8081/), then trying to compile by clicking the bookmarklet shows 'no modules found on this page'.
Are you using the xsiframe linker?
And if you're using GWT 2.5.x, have you enabled SuperDevMode with the devModeRedirectEnabled configuratino property?
So, I'm fetching the .nocache.js file from the code server (http://localhost:9876/ ) instead, while the host page is on the web server.E.g I go to http://localhost:8081/ , which has <script src="http://localhost:9876/MyModule.nocache.js " /> file .This causes compiling via bookmarklet to work.However, when I try to make any gwt rpc requests, they are being made to http://localhost:9876/MyModule/myRequest (code server) rather than to http://localhost:8081/MyModule/myRequest ( web server). I think this is because the base url is being determined by the nocache.js file's location, rather than the host page's url.
Yes.
You can override it using a <meta> in your host page though:
<meta name="MyModule::gwt:property" content="baseUrl=http://localhost:8081/MyModule/">
But that shouldn't be necessary if you configure everything right.
As a result, gwt rpc requests in super dev mode are not working. I get this error:XMLHttpRequest cannot load http://localhost:9876/MyModule/myRequest . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access.How can I resolve this issue? Is anyone able to make gwt rpc work within super dev mode, if so, how did you get it to make the requests to the web server while fetching the nocache.js file from the code server?
1. add <add-linker name="xsiframe"/> to your gwt.xml (and if you're not using GWT 2.6.x, also add <set-configuration-property name="devModeRedirectEnabled" value="true"/>). This will enable SuperDevMode so your bookmarklet on localhost:8081 will now find the module.
2. launch your web server with -Dgwt.codeserver.port=9876 (system property, depending on your server and how you launch it, this might have to be set in some launch script or conf file). This will tell your GWT-RPC servlets to load the serialization policy files from the SuperDevMode CodeServer, so you're sure they're in-sync with the client code running in your browser (that doesn't free you from redeploying the webapp whenever you change anything to your GWT-RPC though, but frees you from having to run the GWT compiler to get up-to-date serialization policies)
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment