9

I m trying to create a GWT app- it has a single HTML file (main.html) and the java class is main.java.

In Eclipse, I did right click-> GWT -> Module and defined the new module correctly.

However after adding some code, when I try to run the app in Dev mode, I get the error

"Could Not find any host pages in project <project-name> "

I have simply added some code to main.java, then saved it and tried to run the app in dev mode... What am I doing wrong here? Is there something I am missing here?

Arvind
  • 6,404
  • 20
  • 94
  • 143
  • Could you post the *.gwt.xml file contents for the module in question? Also, the contents of your web.xml might help in narrowing down the issue... – hatboyzero Mar 28 '12 at 14:47
  • This answer solved it for me: http://stackoverflow.com/a/12430221/67225 – GreenKiwi Aug 28 '13 at 05:54

1 Answers1

25

Normally it could happen if WAR Directory is not defined for this project.

So go to Project properties --> Google(Web Application),

  1. Check the checkbox whcih says "This project has a WAR directory"
  2. In WAR Directoy textbox, browse and give path to your project webapp something like "src/main/webapp"
  3. Check the Checkbox "Launch and Deploy from this directoy"

This should fix your problem.

j0k
  • 22,600
  • 28
  • 79
  • 90
Anand
  • 251
  • 3
  • 3
  • 2
    This helped me fix my problem when re-importing the project. I also had to add another gwt-servlet.jar, because the version had changed. So don't forget dependencies. Thanks for this! This should be marked as the correct answer imo. – Igor Jan 03 '13 at 07:04
  • This can cause some issues when running (later on) in regulare _compiled_ mode. See here: http://stackoverflow.com/a/5745870 – blong Jan 10 '13 at 18:23