2

I am trying to run the Playn example projects. I followed every step in this guide to setup new Playn development environment and then this guide to run sample projects. it seem to work fine but when I try to run the HTML5 version by right click and then going to Google-> GWT compile, nothing happens. I don't see the development mode view poping up to copy the address and paste it to web browser as the guide says. I just get the following in the console window:

   Compiling module playn.showcase.Showcase
   Compiling 1 permutation
      Compiling permutation 0...
   Compile of permutations succeeded
   Linking into L:\playn-samples\showcase\html\war\showcase
   Link succeeded

   Compilation succeeded -- 35.187s

Beyond that nothing happens. If I right click and select run as-> web application, I get the pop out saying

Could not find any hosting pages in the project playn-showcase-html Anybody know what am I doing wrong ?

Ry-
  • 218,210
  • 55
  • 464
  • 476
Fredric T
  • 35
  • 1
  • 10

3 Answers3

3

What you got from the compilation was all good.

"Beyond that nothing happens." is okay.

When you right click on the "playn-showcase-html" project, select "Run As - (g) Web Application", you should get an output to the "Development Mode" tab as "http://127.0.0.1:8888/Showcase.html?gwt.codesvr=127.0.0.1:9997".

If not, check if you have got the following folder structures under the "playn-showcase-html" project:

playn-showcase-html
|...
|--war
   |--Showcase.html
   |--WEB-INF
      |--web.xml
Lin Song Yang
  • 1,936
  • 19
  • 17
  • Thanks 3roo for your help. Yes, I was having a problem with not seeing the "war" folder under playn-showcase-html. After searching, seems like somebody has automated the process of installing PlayN and creating new project.the guide is here [link] http://www.gamefromscratch.com/post/2011/11/06/GFS-PlayN-Installer%E2%80%93Super-detailed-installation-instructions.aspx. – Fredric T Nov 27 '11 at 06:05
  • @FredricToma can you mark this as the right answer if this was indeed the solution? (The checkmark outline under the arrows on the left) – ashes999 Nov 27 '11 at 20:21
0

In the current version of PlayN a jetty server is being started automatically. Right click on the xx-html project "Run As"->"maven install". This starts the GWT compiler, and starts a jetty server (default port is 8080), then you can run the HTML5 version by typing "localhost:8080" in yout browser.

I've also wrote a more detailed description about this on my blog getting started with eclipse and PlayN , maybe this could be interesting.

Paul Weibert
  • 194
  • 1
  • 4
0

As far as I know, you can't simply compile (GWT) and run the HTML version. This is because, the HTML version requires a local web server (such as jetty/tomcat) to host the files in order for the project to be 'run'. However, a simpler way around this would be to try using ant via Eclipse.

Window > Show View > Ant

Once the window appears (probably on a sidebar), right-click and select:

Add Buildfiles...

When the list of projects appear, expand the project by clicking the small arrow to the left of the project name in the list. Then select the ant build file:

build.xml

That will add the ant build file to your list of active build files. Expand similarly to look at the ant tasks provided by the build file. Double click on the appropriate task; in your case:

run-html

OR

Run ant directly on the command-line to get the same results.

prageeths
  • 148
  • 1
  • 8
  • Thanks a lot for your response prageeths. I followed your instructions to test it as Ant build but still unable to. Now when I try to run the run-html I get the following error [java] [ERROR] Unable to find 'playn/showcase/Showcase.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source? Not sure whats going on there !! – Fredric T Nov 26 '11 at 17:54
  • Did 3roo's method work for you? It would have probably fixed up the ant error too. Cheers! – prageeths Nov 27 '11 at 14:34
  • It made sense yes. I used the automated install in the link I supplied and it worked. Now when I modify the code and run as html it won't work. Not sure if I want to continue with this platform its such a hassle. – Fredric T Nov 27 '11 at 18:27
  • 1
    I figured it out finally !! I had matlab server running on my machine using the same port "8888" and causing all the problems. Thanks everyone for the help – Fredric T Nov 27 '11 at 20:52