Error migrating to GWT 2.7.0 (<script> tags in the gwt.xml files)

4,228 views
Skip to first unread message

ssg

unread,
Jan 27, 2015, 12:20:53 PM1/27/15
to google-we...@googlegroups.com
 Hi All,
I am getting the following error while running ANT Build.xml; Please help me in correcting the following.

[java]       [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] js/ext/adapter/ext/ext-base.js

     [java] js/ext/ext-all.js

     [java] In 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'/>

Based on the above message,
STEP 1:
  How do I include these tags in the host page? WHERE is the host page and WHAT all tags I have to include in the host page ?

STEP 2:
 I have added <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/> to my gwt.xml file.

Below is my gwt.xml code;


<?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN" "http://www.gwtproject.org/doctype/2.7.0/gwt-module.dtd">
<module>
    <inherits name="com.google.gwt.user.User" />
    <inherits name='com.google.gwt.json.JSON' />
    <!-- Inherit the GWTEXT stuff.-->
    <stylesheet src="js/ext/resources/css/ext-all.css" />

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

    <script src="js/ext/adapter/ext/ext-base.js" />
    <script src="js/ext/ext-all.js" />
    <inherits name="com.gwtext.GwtExt" />
    <inherits name="com.gwtextux.GwtExtUx" />

    <!-- RPC service servlet declarations -->
    <servlet path="/appname.rpc" class="com.acg.mmsea.server.service.AppnameServiceImpl" />
    <servlet path="/codeDecode.rpc"
        class="com.acg.appname.server.service.AppnameCodesDecodeServiceImpl" />

    <!-- Specify the app entry point class. -->
    <entry-point class='com.acg.appname.gwt.client.Appname' />
</module>

Thanks a lot in advance.


Jim Douglas

unread,
Jan 27, 2015, 12:40:19 PM1/27/15
to google-we...@googlegroups.com
Yeah, this was a hassle for me too.  This is the breaking change in 2.7.0:


I did a few things to bridge the gap from 2.6.1 to 2.7.0.

(1) Add this to the project.gwt.xml to not crash on those <script> tags:

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


(2) Add this to my GWT client entry point (details will vary depending on your specific .js files):

    @Override

    public void onModuleLoad()

    {

        if (Browser.isJQueryLoaded()) // GWT 2.6.1 <script> tags are supported

        {

            if (!Browser.isTouch())

                Browser.setTooltips(BUISupport.initJQueryTooltip());

        }

        else // GWT 2.7.0+; we need to load external script files.

        {

            List<String> injectList = new ArrayList<String>();

            injectList.add("html2canvas.min.js");

            injectList.add("jquery-1.11.1.min.js");

            injectList.add("jquery-ui.min.js");

            inject(injectList);

        }

...

    public static native boolean isJQueryLoaded()

    /*-{

        return (typeof $wnd.jQuery != 'undefined');

    }-*/;


    private void inject(final List<String> p_jsList)

    {

        final String js =

            GWT.getModuleBaseForStaticFiles() + p_jsList.remove(0);


        ScriptInjector.fromUrl(js).setCallback(new Callback<Void, Exception>()

        {

            @Override

            public void onFailure(Exception e)

            {

                Log.log("inject " + js + " failure " + e);

            }


            @Override

            public void onSuccess(Void ok)

            {

                if (!p_jsList.isEmpty())

                    inject(p_jsList);

                else if (!Browser.isTouch())

                    Browser.setTooltips(BUISupport.initJQueryTooltip());

            }

        }).setWindow(ScriptInjector.TOP_WINDOW).inject();

    }

Thomas Broyer

unread,
Jan 28, 2015, 4:45:17 AM1/28/15
to google-we...@googlegroups.com


On Tuesday, January 27, 2015 at 6:20:53 PM UTC+1, ssg wrote:
 Hi All,
I am getting the following error while running ANT Build.xml; Please help me in correcting the following.

[java]       [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] js/ext/adapter/ext/ext-base.js

     [java] js/ext/ext-all.js

     [java] In 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'/>

Based on the above message,
STEP 1:
  How do I include these tags in the host page? WHERE is the host page and WHAT all tags I have to include in the host page ?


The "host page" is the HTML page that loads your GWT app: http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideHostPage
So you'll have to put <script src="js/ext/adapter/ext/ext-base.js"></script> and <script src="js/ext/ext-all.js"></script> in there (adapt the paths as necessary).
 


STEP 2:
 I have added <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/> to my gwt.xml file.

I'd have rather removed the <script> elements from the gwt.xml, but indeed that works too…
 

Below is my gwt.xml code;


<?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN" "http://www.gwtproject.org/doctype/2.7.0/gwt-module.dtd">
<module>
    <inherits name="com.google.gwt.user.User" />
    <inherits name='com.google.gwt.json.JSON' />
    <!-- Inherit the GWTEXT stuff.-->
    <stylesheet src="js/ext/resources/css/ext-all.css" />

I'd also move that to the host page: <link rel=stylesheet href="js/ext/resources/css/ext-all.css" />

ssg

unread,
Jan 29, 2015, 9:02:17 AM1/29/15
to google-we...@googlegroups.com
Thomas,
Thanks a lot very much for your response.

ssg

unread,
Jan 29, 2015, 9:04:16 AM1/29/15
to google-we...@googlegroups.com
Jim,

Thanks a lot very much for your response.

Alain Ekambi

unread,
Jan 29, 2015, 9:18:07 AM1/29/15
to google-we...@googlegroups.com

Also you should really go away from gwt ext. The project has not been updated for years ..

--
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-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Ashish Sahu

unread,
Nov 13, 2015, 6:54:16 AM11/13/15
to GWT Users
Hi Jam,
could please tell me where i have to put point 3 in my code and gimme the proper code as i am migrating the gwt2.4.0 to gwt 2.7.0.
awaiting for your reply
thanks
Reply all
Reply to author
Forward
0 new messages