2

I've upgraded gwt 2.5.1 to 2.6 and ever since the super dev mode launches, I can see bookmarklets at myApp:9876, the modules load, but there's no "compile" button when I click on "Dev Mode On". The code server loads ok, I can see permutations being compiled.

Relevant parts of the build.xml:

<property name="cpstring" value="${toString:gwt-codeserver}" />
    <target name="sdevmode" depends="build-dev">
        <java failonerror="true" fork="true" classname="com.google.gwt.dev.codeserver.CodeServer">
            <classpath>
                <pathelement path="${cpstring}" />
            </classpath>
            <jvmarg value="-Dorg.mortbay.util.FileResource.checkAliases=false" />
            <jvmarg value="-Xmx2g" />
            <jvmarg value="-XX:MaxPermSize=256M" />
            <jvmarg value="-XX:+UseParallelGC" />
            <arg value="-bindAddress" />
            <arg value="0.0.0.0" />
            <arg value="-src" />
            <arg value="${basedir}" />
            <arg value="-workDir" />
            <arg value="/tmp/test" />
            <arg value="path.to.dev" />
        </java>
</target>


     <!-- Super Dev Mode -->
<add-linker name="xsiframe" />
<set-property name="compiler.useSourceMaps" value="true" />
<set-configuration-property name="devModeRedirectEnabled" value="true" />
<set-configuration-property name="gwt.superdevmode" value="on" />
<set-configuration-property name="devModeUrlWhitelistRegexp" value=".*" />

When I inspect the super dev mode div I see an li element with a title "This Module doesn't have Super Dev Mode enabled". The source maps don't load either (server error : 500 ). Any ideas?

Btw: super dev mode launched from intelliJ 13.1 stopped working with this update too (I also updated SDK to 2.6, it made no difference). I haven't changed the configuration:

vmoptions: -Xmx2g
devmode params: -bindAddress 0.0.0.0 -src path.to.my.src

Gwtmodule to load points at my dev module and superdevmode is checked. The exception that I get;

java.lang.RuntimeException: not found: includeSourceMapUrl
    at com.google.gwt.dev.codeserver.Recompiler.overrideConfig(Recompiler.java:314)
    at com.google.gwt.dev.codeserver.Recompiler.loadModule(Recompiler.java:254)
    at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:105)
    at com.google.gwt.dev.codeserver.ModuleState.<init>(ModuleState.java:58)
    at com.google.gwt.dev.codeserver.CodeServer.makeModules(CodeServer.java:120)
    at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:95)
    at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:71)
    at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

Unfortunately I couldn't find much about why does it occur. IntelliJ superdevmode configuration: enter image description here

monika
  • 489
  • 1
  • 7
  • 17
  • Have you tried to remove the configuration-properties? I think, you do not need them anymore. – El Hoss Sep 24 '14 at 10:00
  • Yes, I did. I read a lot about it, in 2.6 and higher you shouldn't need to enable superdevmode, it should be enabled by default. it didn't help unfortunately. – monika Sep 24 '14 at 10:07
  • Did you also start a server which serves the static files? I am using Intellij and I need two servers (a code server and the normal dev server) to get SDM running. – El Hoss Sep 24 '14 at 11:15
  • I am running both the server (static files, spring, tomcat ect) and code server (along with super dev mode) from terminal as two separate build tasks. Since upgrading the superdevmode in IntelliJ doesn't work either (please see an update). – monika Sep 24 '14 at 11:21
  • Hava you tried to add: and ? – El Hoss Sep 24 '14 at 12:44
  • Nope, thanks for a tip! I am in the middle of doing something else now, but I'll give it a shot later on today and will let you know if it made a difference. – monika Sep 24 '14 at 14:22
  • Can you post the running configurations of Intellij? I have no problems using GWT 2.6.1, SDM and Intellij – El Hoss Sep 24 '14 at 15:57
  • Do you mean super dev mode running configuration or project configuration? – monika Sep 24 '14 at 16:01
  • Lets start with the super dev mode running configuration – El Hoss Sep 24 '14 at 16:44
  • Apologies for late reply. I have mentioned the important lines of IntelliJ run configuration for superdevmode above. I can attach a screenshot I suppose. – monika Sep 25 '14 at 15:26

1 Answers1

9

A colleague of mine got to the bottom of this. The main issue was the disabling superdevmode over https in 2.6 which was not the case in earlier releases. Here's the list of tweaks to get superdevmode and source maps working on GWT 2.6 over https:

  1. Define a custom linker that's enabled on ssl pages:

    public class MyLinker extends CrossSiteIframeLinker {

    @Override
    protected String getJsDevModeRedirectHookPermitted(LinkerContext context) {
        return "$wnd.location.protocol == \"http:\" " +
                "|| $wnd.location.protocol == \"https:\" " +
                "|| $wnd.location.protocol == \"file:\"";
    } }
    
  2. Include it in your .xml

    <define-linker name="xsiframe" class="mypath.MyLinker" /> <add-linker name="xsiframe" />
    
  3. Enable Source maps:

    <set-property name="compiler.useSourceMaps" value="true" /> <set-property name="compiler.useSymbolMaps" value="true"/>

  4. Add a whitelisting regex to your dev.xml if you are not working on the local host:

    <set-configuration-property name="urlWhitelistingRegexp" value="http://(.*\.myDesktop\.myDomain|localhost)(:\d+)?/.*" />

  5. Make sure that you are gwt codeserver is in the path.

Posting the answer hoping that some day, someone may find it useful.

monika
  • 489
  • 1
  • 7
  • 17