Problem with running Maven GWT application in Eclipse

I'm trying to create a GWT project through WebAppCreator enabled Maven2.

Project creation steps:

  • Create project with WebAppCreator (i'm using gwt-2.3.0)

    webAppCreator -noant -maven -XnoEclipse -out MyApp com.example.MyApp

  • Import project as existing maven project in eclipse (helios)
  • Enable "Project" -> "Properties" -> "Google" -> "Google web toolkit" -> "Use google web toolkit" checkbox
  • Set in project properties "Google" -> "Web application" -> "This project has a WAR directory". Set WAR directory path "src/main/webapp" and uncheck "launch and deploy from this directory"
  • Java build path is "MyApp/target/www/WEB-INF/classes"
  • I did not change the settings in pom.xml
  • Compile project using gwt eclipse plugin (2.3.0 version). It successfully compiled.
  • Try to run project as Web Application. When i run application GWT plugin does not ask me about WAR folder. I did all this, I saw in the logs:
  • [WARN] Server class 'com.example.server.GreetingServiceImpl' could not be found in the web app, but was found on the system classpath

    [WARN] Adding classpath entry 'file:/home/redfox/workspace/java/redfox/MyApp/target/www/WEB-INF/classes/' to the web app classpath for this session

    [WARN] Server class 'com.google.gwt.user.client.rpc.RemoteService' could not be found in the web app, but was found on the system classpath

    [WARN] Adding classpath entry 'file:/home/redfox/.m2/repository/com/google/gwt/gwt-servlet/2.3.0/gwt-servlet-2.3.0.jar' to the web app classpath for this session

    And when i try to load page from URL (http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997) i see 404 error. In logs i don't see any errors. How can i run this default application? Also i have another question: if this problev will be solved, how can i run this application in web mode (not in development mode) for using links like "http://127.0.0.1:8888" whithout param gwt.codesvr?

    PS Sorry for my bad English.


    I understand your frustration, trust me, I recently went through exactly the same issue you having now.

    As Eugene indicated, follow his instructions, but...

    On the Select an Archetype choose version 2.3.0-1 (Others may work but this one works for me)

    选择一个原型

    Generate your sample app using theat Archtype version. Do a mvn gwt:run, you will see this screen (If all goes well) Click on "Launch Default Browser".

    Good luck. Cheers PB

    发射台


    I know this question is two years old. But i just had the same issue and now figured out how to fix it.

    When eclipse doesn't ask you at the first launch for your "WAR" directory, you can also set it manually:

    In eclipse go to "Run" -> "Debug Configuration...". Select your "Web Application" -> Select the "Arguments"-Tab and add the parameter eg "-war C:YourProjectPathtargetYourProject-1.0-SNAPSHOT". Provide the full path here pointing to your target, generated by maven.

    Hope that helps someone solving this issue faster :)


    I know this is old, but here is my latest approach (as also answered here)

    I can't speak for the webAppCreator because I haven't used it, but I have had good luck creating the Maven projects in Eclipse using the gwt-maven-plugin from codehause.

    Creating a Maven GWT Project Directy in Eclipse

  • Open the new project wizard in Eclipse and filter on Maven Project.

  • Select the Maven Project and click next.

  • Enter the project location of your preference and click next.

  • Enter "gwt-" into the archetype filter and select the gwt-maven-plugin from codehaus. Click Next.

  • Enter your maven project details and a module value, then click Finish.

  • This will create a maven - gwt project for you in Eclipse. This comes with a sample application that you can use to make sure you can launch the application correctly.

    Running the Application Command Line

  • Open command line.
  • Navigate to your project home.
  • Run the command "mvn clean package".
  • Run the command "mvn gwt:run"
  • This should get you up and running. If you used the 2.7.0 gwt-maven-plugin this should run the application in super dev mode by default.

    Run the application in Eclipse

  • As you have done, navigate to Properties > Google > Web Application and check "This project has a WAR directory". The WAR directory using this plugin should be src/main/webapp.
  • Navigate to Properties > Google > Web Toolkit and check "This project has a WAR directory. You may be able to specify the module here. I am actually unable to do so, it may be specific to my Google Plugin for Eclipse or something environment specific...
  • Run As > Web Application.
  • If you had issues, as I have had, in step 2 then you will get an error Missing required argument 'module[s]' . To fix this open up your run configuration (should have been auto created) and in the arguments tab add the package qualified name for your module at the end of the arguments, eg com.mycompany.abc.GwtSampleModule. Do not add the ".gwt.xml" prefix.
  • It's worth also checking that the HTML page referenced in your arguments is correct, I have also had issues with that.
  • The application should now be configured for Launch in Eclipse using this run configuration. My verified environment is:

  • Eclipse Luna (v4.4)
  • Google Plugin for Eclipse (v3.8)
  • GWT Maven Plugin (v2.7.0)
  • 链接地址: http://www.djcxy.com/p/24272.html

    上一篇: 在eclipse中自动化GWT构建

    下一篇: 在Eclipse中运行Maven GWT应用程序的问题