1

Possible Duplicate:
GWT module may need to be (re)compiled REDUX

I have created a gwt project with eclipse and when I try this project in debug mode ( with GWT's server ) it works.

But when I tried to deploy apache tomcat server, this error message is displaying :

The page at localhost:8080 says: GWT module 'gwtfileupload' may need to be (re)compiled

i used this tutorial to accomplish the deployment : https://wiki.auckland.ac.nz/display/BeSTGRID/Deploying+GWT+to+Tomcat+in+Eclipse


here's the "warbuilder.xml" :

<target name="default" depends="buildwar,deploy"></target>

<target name="buildwar">
    <war basedir="war" destfile="gwtfileupload.war" webxml="war/WEB-INF/web.xml">
        <exclude name="WEB-INF/**" />
        <webinf dir="war/WEB-INF/">
            <include name="**/*.jar" />
        </webinf>
    </war>
</target>

<target name="deploy">
    <copy file="gwtfileupload.war" todir="." />
</target>

here's the project tree
  |gwtfileupload
  |-src
  |---com
  |-----hsn
  |-------demo
  |---------gwtfileupload
  |-----------client
  |-------------------GWTFileUpload.java
  |-----------server
  |-------------------FileUploadServlet.java
  |-war
  |---gwtfileupload.css
  |---gwtfileupload.html
  |---WEB-INF
  |-----web.xml
  |-----lib
  |---------commons-fileupload-1.2.1.jar
  |---------gwt-servlet.jar
  |---------commons-io-1.4.jar

here's the war file tree
  |-gwtfileupload.html
  |-gwtfileupload.css
  |-META-INF
  |---MANIFEST.MF
  |-WEB-INF
  |---web.xml
  |---lib
  |------commons-fileupload-1.2.1.jar
  |------gwt-servlet.jar
  |------commons-io-1.4.jar
  |------gwtfileupload.jar
  |-gwtfileupload
  |---clear.cache.gif
  |---gwtfileupload.nocache.js
  |---hosted.html
  |---gwt
  |-----standard
  |-------images
  |---------ie6

Could you help me to fix this problem?

Community
  • 1
  • 1
dorukkangal
  • 41
  • 1
  • 2
  • 7
  • This is a lost cause. Don't where to begin to tell you. The project you downloaded follows the maven dependency and deployment pattern. You have to learn maven. – Blessed Geek Mar 27 '12 at 00:37

3 Answers3

3

Clear your browser cache.

Travis Webb
  • 14,688
  • 7
  • 55
  • 109
1

Looking at your "war file tree", there's no .cache. file. It looks like you didn't GWT-Compile your project!

See https://developers.google.com/web-toolkit/doc/latest/DevGuideCompilingAndDebugging#DevGuideProdMode You'll have to call the compiler with a java task in your Ant file.

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
0

Dev mode replaces the .nocache.js file with a copy that emits that error. It does this at least when the page is launched in dev mode, and possibly when dev mode starts (I haven't pinned down exactly when this occurs, just reporting based on cases I've seen in the past). It only replaces the copy in the directory it is told to use for the war, so if you are deployed to another servlet container, it shouldn't be affected.

Best way to prevent this is to not launch or use dev mode after compiling your Java to JS, but only run the app from a servlet container like tomcat. If dev mode is already running when you start the compile, this shouldn't be an issue, but don't load any url ending with gwt.codesvr=localhost:9997, as that will cause dev mode to overwrite the .nocache.js file again.

Colin Alworth
  • 17,801
  • 2
  • 26
  • 39
  • DevMode compares the date of the existing nocache.js with the date of the gwt-dev.jar, and generates a new file if its older than the gwt-dev. See http://stackoverflow.com/questions/5719118/gwt-module-may-need-to-be-recompiled-redux – Thomas Broyer Mar 27 '12 at 10:09
  • Hmm, wonder what I'm seeing then - I've seen it on several machines/OSes, all using Eclipse 3.7, GPE 2.5, GWT 2.4.0 and maven, so reading the gwt-dev from `.m2/`. Edit: and yes, building to `target/project-vers/`. – Colin Alworth Mar 27 '12 at 12:33
  • You're, right, this has changed in newer versions: it replaces the nocache.js if it's older than the gwt.xml. See http://code.google.com/p/google-web-toolkit/source/browse/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java#272 and http://code.google.com/p/google-web-toolkit/source/browse/trunk/dev/core/src/com/google/gwt/dev/util/OutputFileSetOnDirectory.java#46 – Thomas Broyer Mar 27 '12 at 13:23