3

I'm deploying an app to GAE. I have a single project setup in Eclipse, with three separate GWT modules, each with its own HTML page, entry point, etc. They share a lot of code.

When I deploy the app to appengine, TWO of the modules work fine. I can access their HTML pages perfectly. The third gives me the error that "gwt module 'xyz' may need to be (re)compiled." I have tried recompiling and redeploying twice, to no avail, and have no ideas about moving forward.

Other threads about this problem point to the gwt.codeserver argument, and indeed, if I add that argument, the bad module runs... but it seems to be running in dev mode! If this is true, I'm a little bit apalled, since I don't want to serve dev mode code to anyone.

Any suggestions would be welcome - my work is basically entirely stalled on this issue.

Riley Lark
  • 20,660
  • 15
  • 80
  • 128

4 Answers4

8

I've found my own answer: in my case, the error was not being caused by a missing gwt.codesvr argument (as in all other cases I found referenced online). Instead, a module rename-to attribute I added in my module definition gwt.xml file caused a mixup. I'll recount the whole story in case it helps others understand more.

  1. I created a new module and a new HTML page.
  2. The module's name was com.reallylong.and.unwieldy, and my HTML page pulled in the javascript from com.reallylong.and.unwieldy/com.reallylong.and.unwieldy.nocache.js.
  3. Later, I got smart and used the rename-to attribute to rename com.reallylong.and.unwieldy to "short," not changing my HTML code. I forgot.

This didn't affect me for several days, since I guess eclipse is smart enough to recompile both files, or something. Who knows. I suspect the gwt.codesvr argument was actually enabling this obscuring behavior, loading the code from dev mode instead of from the js file.

Ultimately, the fix was simple: I changed my HTML file so that the js was being pulled from short/short.nocache.js. And it worked! Woohoo!

alepuzio
  • 1,382
  • 2
  • 28
  • 38
Riley Lark
  • 20,660
  • 15
  • 80
  • 128
2

Adding these lines to XXX.gwt.xml file worked for me: (GWT version 2.5.1)

<add-linker name="xsiframe" />
<set-configuration-property name="devModeRedirectEnabled"
    value="true" />
<set-property name="compiler.useSourceMaps" value="true" />
Bosco
  • 3,835
  • 6
  • 25
  • 33
  • Worked for me too. I used GWT 2.7.0, and without this exported war (with properly compiled GWT) did work in IE only. With this it works for Chrome and Firefox too. – Piro Jun 15 '17 at 06:23
1

Here is the code that throws this message.

function B() {
    var b = false;
    try {
    var c = Window.location.search;
    return (c.indexOf("gwt.hosted=") != -1 
        || (c.indexOf("gwt.codesvr=") != -1
        || Window.external && Window.external.gwtOnLoad)) 
        && c.indexOf("gwt.hybrid") == -1
    } catch (a) {}
    B = function () {
    return b
    };
    return b
}
// and later, if B() returns false, show recompile error
if (!B()) {
    try {
    alert(Pb);
    return;
    }
  ...
}

Thus, to prevent the compiler message

  • don't have gwt.hybrid in the URL
  • AND DON't have gwt.hosted=
  • OR get.codesvr=
  • OR a Window.external.getOnLoad method

That being said, when I don't have this problem, this code is not compiled into the *.nocache.js file, so that is where the true bugaboo lies.

Joseph Lust
  • 19,340
  • 7
  • 85
  • 83
0

I solved it in two steps:

  1. in eclipse click on the red icon "GWT compile project"

  2. in eclipse right clik -> run as Maven package

sra
  • 23,820
  • 7
  • 55
  • 89
geko
  • 1