0

Problem: Keep getting "module 'xxx' may need to be (re)compiled".

Steps:

  1. Importing a sample GWT-Maven project into eclipse ("MobileWebApp" - from the GWT SDK).
  2. GWT|compile the project.
  3. Running in production mode (without the codesvr parameter, i.e. using "localhost:8888/MobileWebApp.html").

Notes:

  1. I am fairly new to both GWT and Maven.
  2. I read GWT module may need to be (re)compiled REDUX.
  3. Dev mode does work (I am able to debug the application).

Detailed Steps:

  1. Copying the "MobileWebApp" folder from the "samples" folder inside the GWT SDK (version 2.5.1) to my eclipse workspace.
  2. Importing the project: File->Import->Existing Maven Projects (pointing to the "MobileWebApp" folder where the pom.xml exists.
  3. Configuring the project following these steps: https://developers.google.com/eclipse/docs/faq?hl=iw#gwt_with_maven
  4. At this point I am able to run the app as "Web Application" and debug it.
  5. Running GWT|Compile: The nocache.js stuff is being placed in the target folder.
  6. Now, when i try to run the app in production mode I am getting the (re)compile error.

Logs:

  1. "DataNucleus Enhancer (version 1.1.4) : Enhancement of classes DataNucleus Enhancer completed with success for 0 classes. Timings : input=713 ms, enhance=0 ms, total=713 ms. Consult the log for full details DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details"

  2. "Compiling module com.google.gwt.sample.mobilewebapp.MobileWebApp Validating units: Ignored 1 unit with compilation errors in first pass. Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. Compiling 6 permutations Compiling permutation 0... Compiling permutation 1... Compiling permutation 2... Compiling permutation 3... Compiling permutation 4... Compiling permutation 5... Compile of permutations succeeded Linking into D:\workspace\eclipse\MobileWebApp\target\MobileWebApp-1.0-SNAPSHOT\mobilewebapp Invoking Linker AppCacheLinker Be sure your landing page's tag declares a manifest: Link succeeded Compilation succeeded -- 152.077s"

  3. "Initializing App Engine server

    06/07/2013 20:12:33 com.google.apphosting.utils.jetty.JettyLogger info INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger 06/07/2013 20:12:33 com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml INFO: Successfully processed D:\workspace\eclipse\MobileWebApp\target\MobileWebApp-1.0-SNAPSHOT\WEB-INF/appengine-web.xml 06/07/2013 20:12:33 com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml INFO: Successfully processed D:\workspace\eclipse\MobileWebApp\target\MobileWebApp-1.0-SNAPSHOT\WEB-INF/web.xml 06/07/2013 20:12:34 com.google.apphosting.utils.jetty.JettyLogger info INFO: jetty-6.1.x 06/07/2013 20:12:36 com.google.apphosting.utils.jetty.JettyLogger info INFO: Started SelectChannelConnector@0.0.0.0:8888 06/07/2013 20:12:36 com.google.appengine.tools.development.DevAppServerImpl start INFO: The server is running at localhost:8888/ 06/07/2013 20:12:36 com.google.appengine.tools.development.DevAppServerImpl start INFO: The admin console is running at localhost:8888/_ah/admin Linking modules Bootstrap link for command-line module 'com.google.gwt.sample.mobilewebapp.MobileWebApp' Linking module 'mobilewebapp' Invoking Linker AppCacheLinker DevMode warning: Clobbering appcache.nocache.manifest to allow debugging. Recompile before deploying your app! Be sure your landing page's tag declares a manifest: 06/07/2013 20:13:38 com.google.apphosting.utils.jetty.AppEngineAuthentication$AppEngineAuthenticator authenticate INFO: Got /MobileWebApp.html but no one was logged in, redirecting."

Pom.xml: https://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/mobilewebapp/

Thanks ahead.

Community
  • 1
  • 1
talsi
  • 11
  • 1
  • 5
  • Did you look at [this](http://stackoverflow.com/questions/2975694/vaadin-gwt-error-module-xxx-may-need-to-be-recompiled) and [this question](http://stackoverflow.com/questions/3688067/some-subtlety-of-gwt-compilation-gwt-module-may-need-to-be-recompiled)? – Mia Clarke Jul 06 '13 at 20:33
  • How do you "run the app in production mode" ? – Thomas Broyer Jul 07 '13 at 12:34
  • Mia - I did read those questions, more than once, unfortunately it did not help me much. – talsi Jul 08 '13 at 00:44
  • Thomas - By "run the app in production mode" I mean to say that 1) I compile the project with: right clicking on the project -> Google -> GWT Compile. 2) right clicking on the project -> Run As -> Web Application. 3) open browser and navigating to "localhost:8888/MobileWebApp.html" (without the codesvr parameter) so that the app will run based on the compiled javaScript - not with the JVM Debugger. – talsi Jul 08 '13 at 00:48
  • I must note once again that I am new to maven and therefore I am obviously missing some fundamental core knowledge. Problem is gwt + maven info is scattered all over the net referencing to spesific and different versions. Any link to up-to-date info about how to work with maven and gwt would be much appreciated. – talsi Jul 08 '13 at 00:50

2 Answers2

0

Answering my own question:

1) from command: "mvn gwt:run".

2) Google|GWT compile.

P.S. As much as I am happy figuring that out (after agonizing couple of days) I would still like to know the reasons of why I have to - first lunch the app then compile it. Very strange - in my humble opinion.

offtopic: This sample app was supposed to be "offline executable" (from mobile, at the very least) - so how exactly do I test it? I tried (after running the app once or twice from mobile device, so that it will be cached) to switch to airplane mode and navigating to the app (just like he demonstrated) but, obviously(?), the server is not reachable.. Do I need to enable something specific for it to work? (my mobile device is Google-Nexus-4)

talsi
  • 11
  • 1
  • 5
0

Multiple steps:

  1. Update Project properties -> deployment Assembly using Deploy GWT maven project with eclipse deploys webapp directory instead of target/project directory

  2. mvn clean package

  3. mvn gwt:compile
  4. In eclipse, click on 'GWT Compile Project' -> Advacned -> Remove '-war src/main/webapp' argument and hit compile.

Output should be like this - Linking into target/project-1.0-SNAPSHOT/ModuleName

Now the deployment should work fine.

Community
  • 1
  • 1
tj-recess
  • 1,781
  • 11
  • 15
  • Thanks, at this point of time however I have decided to neglect the use of maven as a build tool for my gwt app-engine application. With the google-plugin for eclipse doing such a great job and the steep learning curve of setting up maven to build my project I choose to keep copying jar's into my project and maybe later migrate to maven – talsi Apr 26 '14 at 20:46