How To Bypass GWT Same Origin Policy (SOP) In Chrome
Posted by blogmeister on
March 15, 2012
GWT‘s Same Origin Policy (SOP) problem is common especially for newbies. This happens if your GWT front end client accesses a remote service that is hosted in the same local domain in your PC but having a different port.
Browsers still considers this a violation of the SOP policy. I have read that Internet Explorer has a lax web security policy so you may be able to use that without encountering this restriction. However, Internet Explorer sucks and Firefox is just too damn heavy to load even with just one tab.
So I am left with Google Chrome. You can run Google Chrome with web security disabled but I would advise you to create it as a shortcut in Windows and create an alias in Mac OS. Here is how I did them.
Windows
- right click anywhere on your desktop, choose New > Shortcut
- then type this in the text field C:\Users\[USERNAME]\AppData\Local\Google\Chrome\Application\chrome.exe -allow-file-access-from-files -disable-web-security
- click OK
Mac OSX
- open Terminal
- edit your .profile file
- add this to the end of the file alias chromegwt=’/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome -disable-web-security’
- save file
- close Terminal window or open a new Terminal window tab then type chromegwt and you should then see Google Chrome launch without web security.
Note: you can rename it any name you want. I just used chromegwt so I would know that this Chrome is used only for GWT purposes.
Remember not to use this same browser when browsing the web as it can lead to disastrous results.
Found this useful? Donations appreciated to help keep this blog alive.tags: alias, chrome, firefox, google web kit, gwt, ie, internet explorer, same origin policy, shortcut, sop
No Comments
Fix The Unable To Restore The Previous TimeZone In GWT
Posted by blogmeister on
March 12, 2012
This is a fairly common problem that newbies using Google Web Kit within Eclipse encounter with their the Java Runtime Environment. Chances are you just upgraded your JRE to 1.6.0_31.
The solution is to add an extra parameter in your virtual machine run configuration using either:
-Dappengine.user.timezone=UTC
If that does not work, try this.
-Dappengine.user.timezone.impl=UTC
To go to the run configuration, do the following:
- Right click project name
- Go to Run As > Run Configurations
- Go to Arguments tab
- Under VM Arguments, add the extra parameter, then click Run button
There you go! That should get you back into development mode!
Found this useful? Donations appreciated to help keep this blog alive.







