问题
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.
回答1:
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.
- I created a new module and a new HTML page.
 - 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.
 - 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!
回答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" />
    回答3:
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.
回答4:
I solved it in two steps:
in eclipse click on the red icon "GWT compile project"
in eclipse right clik -> run as Maven package
来源:https://stackoverflow.com/questions/3688067/some-subtlety-of-gwt-compilation-gwt-module-may-need-to-be-recompiled