Currently I’m writing NetFlow analyser as a Rich Internet Application. After long consideration and evaluation of available open-source technologies I have concluded that GWT will be the best shot in this case (now I’m not so sure any more, but this is another story). To make building nice user interface easier I have decided to equip user side CLASSPATH with GWT-Ext library. GWT-Ext reuses ExtJS and ExtJS needs some underlying JavaScript framework. A lot of people use YUI as base for ExtJS, so automatically I have started to use it too. And this is where the first problems arose.
As most people do, to load YUI I used:
<script type="text/javascript"
src="js/ext/adapter/yui/ext-yui-adapter.js"></script>
which caused following error:
[ERROR] Failure to load module 'null'
com.google.gwt.dev.shell.HostedModeException: Can't find frame window for 143347568
at com.google.gwt.dev.shell.BrowserWidget.doUnload(BrowserWidget.java:352)
[...]
but only when running in GWT’s hosted mode, so it looked like a bug in Linux implementation of hosted mode’s engine (most people use Windows and do not report such problems).
After some experiments I found first workaround: using JQuery instead of YUI. Full ExtJS setup looked like this:
<link rel="stylesheet" type="text/css" href="js/ext/resources/css/xtheme-aero.css" />
<link rel="stylesheet" type="text/css" href="js/ext/resources/css/ext-all.css"/>
<script type="text/javascript" src="js/ext/adapter/jquery/jquery.js"></script>
<script type="text/javascript" src="js/ext/adapter/jquery/jquery-plugins.js"></script>
<script type="text/javascript" src="js/ext/adapter/jquery/ext-jquery-adapter.js"></script>
<script type="text/javascript" src="js/ext/ext-all.js"></script>
Next day, Sanjiv Jivan (author of GWT-Ext) gave mi a hint, that changing JavaScript injecting method from HTML’s <script> tag to same tag in .gwt.xml, can help. I have removed all JavaScript stuff from HTML page and put following lines in .gwt.xml:
<script src="js/ext/adapter/yui/yui-utilities.js"/>
<script src="js/ext/adapter/yui/ext-yui-adapter.js"/>
<script src="js/ext/ext-all.js"/>
finally solving the problem.