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.

4

2 回答 2

0

回答我自己的问题:

1)来自命令:“mvn gwt:run”。

2) 谷歌|GWT 编译。

PS 尽管我很高兴(经过几天的痛苦)弄清楚了这一点,但我仍然想知道为什么我必须这样做 -首先午餐应用程序然后编译它。很奇怪-在我看来。

offtopic这个示例应用程序应该是“离线可执行文件”(至少来自移动设备) - 那么我该如何测试它呢?我尝试(在从移动设备运行应用程序一次或两次之后,以便将其缓存)切换到飞行模式并导航到应用程序(就像他演示的那样)但是,显然(?),服务器无法访问。 . 我是否需要启用某些特定功能才能使其工作?(我的移动设备是 Google-Nexus-4)

于 2013-07-09T18:51:27.993 回答
0

多个步骤:

  1. 使用Eclipse 部署 GWT maven 项目更新项目属性 -> 部署程序集部署 webapp 目录而不是目标/项目目录

  2. mvn 清洁包

  3. mvn gwt:编译
  4. 在 Eclipse 中,单击“GWT 编译项目”-> Advacned -> 删除“-war src/main/webapp”参数并点击编译。

输出应该是这样的 - Linking into target/project-1.0-SNAPSHOT/ModuleName

现在部署应该可以正常工作了。

于 2014-03-24T00:53:17.123 回答