0

I created a new PlayN project from the 1.2 archetype using the command line given in the GettingStarted wiki page. I then imported this Maven Project into Eclipse, just bringing in the core, java, and html modules. If I right-click the Java project, I can choose my main class, and a window pops up with the background image shown. Note that I've done no real programming yet: I'm just using the default project configuration.

Next, I used GWT-compile through Eclipse on the HTML project, and I got no errors. When I run it as a Web application by using the provided URL (without removing the "?gwt.codesvr=127.0.0.1:9997" bit), the application runs fine aside the Eclipse Console gives a warning about being in Development Mode. (Specifically, "You are running in GWT Development Mode. For optimal performance you may want to use an alternative method.")

However, if I run the application the recommended way, by removing the gwt.codesvr parameter, then I keep getting a dialog box saying "GWT module 'testproject' may need to be (re)compiled."

After reading How do I run a maven/eclipse/GWT/playN app in production mode?, I tried doing mvn test -Ptest-html and then pointing my browser at http://localhost:8080, but it gives the same error.

Am I doing something wrong?

(EDIT: I have no idea if this next point is significant or not, but I'll share it anyway. When I try to create a project from Eclipse, the newest PlayN archetype I can see is 1.0.3, even after telling Eclipse to update the Maven index. I'm running Eclipse Indigo.)

Community
  • 1
  • 1
Paul Gestwicki
  • 1,610
  • 1
  • 15
  • 18
  • Could it be http://stackoverflow.com/questions/5719118/gwt-module-may-need-to-be-recompiled-redux ? – Thomas Broyer May 02 '12 at 14:23
  • 1
    My GWT/HTML5 workflow is: right click > run as web application > open chrome > paste non-dev-mode url in address bar (or refresh page) > get recompile error message or blank screen > back to eclipse, right click > GWT > compile > back to chrome > refresh page > SUCCESS! Maddening and ritualistic, but it works. So you might just try recompiling GWT after you see the error and then reload the browser page. – klenwell May 02 '12 at 15:15

1 Answers1

2

I guess you are running PlayN 1.0.3.

There is a bug in 1.0.3: So you need to do the following:

  1. Run GWT-Compile

  2. Run the web application and get the error message: "GWT module 'testproject' may need to be (re)compiled."

  3. Run again GWT-compile, while the Web-Application is running

  4. Reload your browser with CTRL-F5

The important step is step 3.

Note: You can update to PlayN 1.2 to get rid of the error. For this you have to change the file playn-showcase/pom.xml.

Change the line <version>1.0.3</version> to <version>1.2</version>

user1141785
  • 431
  • 7
  • 21
  • Sure enough, as you and klenwell have said, this workflow led to successful execution. What puzzles me is why or whether this is running 1.0.3 when I checked out the samples as specified in the wiki. Is it possible the samples haven't been updated to 1.2? I'm running 1.2 in a separate project now and doing the GWT builds from the command line, and that's worked fine for me. – Paul Gestwicki May 07 '12 at 13:28