Thursday, June 11, 2020

Re: GWT Super devmode is not working for me

In GWT 2.7.0 (specifically in the first release candidate), SDM was made the default, and IFrameLinker, XSLinker were deprecated since they didn't work properly with SDM. You can reenable them in your own project though. However, the replacement linker is mentioned in the release notes as having some limitations, especially around <script> tags in your .gwt.xml file. [1]

An issue was filed to track limitations in this new linker. [2] [3]

There is also another discussion that was started around the same thing. [4] [5]


As I understand it, there are two main ways to support this case now: either include those scripts in your initial .html file that loads your GWT module, or use ScriptInjector [6] to load each script that you want to run. Moving the <script> tags to your html file and placing them before your .nocache.js script tag has the advantage of completely keeping them out of code and letting you reference them directly, whereas ScriptInjector has other benefits: if you don't need the files right away, you can defer loading them until just before you need them, and can listen to callbacks to indicate that they are loaded. ScriptInjector also has a mechanism by which you can pass the full string of the script's contents rather than a file, so that you can include the script in your .cache.js output, instead of making each file load individually without "perfect caching" [7], adding a bit of delay to your app startup. This would be achieved through creating TextResources or ExternalTextResources in a ClientBundle [8].

One word of caution: you probably are relying on those script files being included into your main page (rather than the GWT iframe), so you will probably need to include a call to .setWindow(ScriptInjector.TOP_WINDOW) when you make up the ScriptInjector call, so that your JSNI correctly references this code.

In either case, the .js file needs to be where the app can load it. In GWT, this usually means creating a public/ directory in the same package as your client/ and your .gwt.xml file. Then, the URL you pass to ScriptInjector should be prefixed with GWT.getModuleBaseForStaticFiles() so that it loads correctly. For example, if you created a com/myproject/public/sc/modules/ISC_Core.js file in your sources, you could reference it as:

ScriptInjector.fromUrl(GWT.getModuleBaseForStaticFiles() + "sc/modules/ISC_Core.js")

or, in the main html page as <script src="App/sc/modules/ISC_Core.js"></script>.
Since you've mentioned SmartGwt, I'm guessing that these files are already in a public/ directory inside a SmartGWT jar, and you can skip this last section.

[2] which was moved to github:

On Thursday, June 11, 2020 at 10:13:09 AM UTC-5, ruwan samaraweera wrote:
I'm using gwt since so many years back. To debug my application those days I've used gwt devmode. But now the plugin is not support in modern browser(Im using lates version of Chrome). So I tried to used super devmode. But unfortunately I couldn't able to configure it correct way. It is given many errors and I cant debug my application.  
Actually Im developing web application using gwt 2.6.1 and java 1.8 and deploying it in tomcat9 webserver.
My configuration as follows.

gwt.xml file

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='App'>

<inherits name="" />
<!--<inherits name="com.smartgwt.SmartGwt"/>-->
<inherits name="com.smartgwt.SmartGwtNoTheme" />
<inherits name="com.smartgwt.SmartGwtNoScript"/>
<inherits name="com.smartgwtee.SmartGwtEENoScript"/>

<inherits name="com.smartgwt.Drawing"/>
<inherits name="com.smartgwt.Charts"/>
<inherits name=""/>
<inherits name="com.smartgwt.Analytics"/>
<stylesheet src='../pages/resources/mmv-style.css'/>
<inherits name="com.smartclient.theme.enterpriseblue.EnterpriseBlue" />
<inherits name="com.smartclient.theme.enterpriseblue.EnterpriseBlueResources"/>
<inherits name=''/>

<entry-point class="mywebapp.client.AppEntryPoint" />

<source path="client"/>
<source path="shared"/>

<add-linker name="xsiframe"/>

<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>

<extend-property name="locale" values="en" />

<!-- Following should exist only in Development mode-->
<!--<inherits name="" />-->
<set-property name="user.agent" value="safari" />


Hear I've add xsiframe linker and other configuration tag as well
Apart from that I've added following tags in my host page.

script src="App/sc/modules/ISC_Core.js"></script>
<script src="App/sc/modules/ISC_Foundation.js"></script>
<script src="App/sc/modules/ISC_Containers.js"></script>
<script src="App/sc/modules/ISC_Grids.js"></script>
<script src="App/sc/modules/ISC_Forms.js"></script>
<script src="App/sc/modules/ISC_RichTextEditor.js"></script>
<script src="App/sc/modules/ISC_Calendar.js"></script>
<script src="App/sc/modules/ISC_DataBinding.js"></script>
<script src="App/sc/modules/ISC_Drawing.js"></script>
<script src="App/sc/modules/ISC_Charts.js"></script>
<script src="App/sc/modules/ISC_Analytics.js"></script>
<script src="App/sc/skins/SilverWaveX/load_skin.js"></script>

Im using ant target to build application and making war file and place it tomcat9. So same way Im using ant target to run superdevmode as follows.

<target name="superDevMode" description="Run GWT debug mode">
<java failonerror="true" fork="true" classname="">
<fileset dir="${proj.gwt.debug.sdk}" includes="*.jar" />
<path refid="project.class.path" />
<jvmarg value="${proj.runtime.initmemory}" />
<jvmarg value="${proj.runtime.maxmemory}" />
<jvmarg value="${proj.runtime.permgensize}" />
<jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${proj.gwt.debug.client.debug.port}" />
<!--<arg value="-noserver" />-->

<arg value="-port" />
<arg value="${proj.gwt.debug.server.http.port}" />
<!--<arg value="-startupUrl" />-->
<!--<arg value="/${}" />-->
<arg value="${proj.gwt.module}" />

 In properties.xml file

<!-- Following properties are used to GWT DEBUGGING -->  	<property name="proj.gwt.debug.sdk" location="D:Project\myApp\gwt\gwt-2.6.1" />  	<property name="proj.gwt.debug.server.http.port" value="8080" />  	<property name="proj.gwt.debug.client.debug.port" value="5028" />

But when I'm running ant target it is giving following error
 [ERROR] The Cross-Site-Iframe linker does not support <script> tags in the gwt.xml files, but the gwt.xml file (or the gwt.xml files which it includes) contains the following script tags:
     [java]     at
     [java] sc/modules/ISC_Core.js
     [java]     at
     [java] sc/modules/ISC_Containers.js
java]     at order for your application to run correctly, you will need to include these tags in your host page directly. In order to avoid this error, you will need to remove the script tags from the gwt.xml file, or add this property to the gwt.xml file: <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>       [java]       [java]     at

It is great if some one can help me on this.


You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

No comments:

Post a Comment