GWTP, Eclipse and Maven

aktualisiert am 18. Dezember 2012


This is my summery of how I use to set up a GWTP application in eclipse as a maven project. I am using eclipse with the following plugins installed:

First I create a new GWTP project using the GWTP plugin:

Next I add a pom-file: pom.xml

Next I run ,,Configure / Convert to Maven Project''.

I then get the error message ,,The output directory for the project should be set to /myapp/war/WEB-INF/classes''.

I am getting rid of the message above by doing the following configuration.

Next I add a presenter using the GWTP menu. My app looks now as follows: myapp.

I can run myapp by ,,Run As / Web Application.

Things start to get nasty when I add an action. Assume I add an action that just prints ,,Hello World'' on the eclipse console if someone pushes the button ,,Do Action'' on default page.

When I click ,,Do Action'' now I get an error message: ,,WARNING: Service exception while executing ch.boeser.myapp.client.DoAction: No handler is registered for ch.boeser.myapp.client.DoAction''. By now the app looks like myapp.

I can get rid of the error message above by compiling the project using maven and copying the class files to the appropriate places. ,,myapp'' is located at ,,~/workspace/myapp''.

  1. cd ~/workspace/myapp
  2. mvn clean compile
  3. cp -r target/classes war/WEB-INF/

Now I still got issues like ''Server class 'com.google.inject.servlet.GuiceServletContextListener' could not be found in the web app, but was found on the system classpath''. I quick search brings up Web App Classpath Problem.

Issues

Unable to find on your classpath

I can modifiy the corresponding path of Myapp.gwt.xml which leads to the error message below by editing the arguments section of ''Run Configurations...''.

      
	Loading modules
	main.java.ch.boeser.myapp.Myapp
	Loading inherited module 'main.java.ch.boeser.myapp.Myapp'
	[ERROR] Unable to find 'main/java/ch/boeser/myapp/Myapp.gwt.xml'
	on your classpath;
	could be a typo, or maybe you forgot to include a classpath entry for
	source?
	[ERROR] shell failed in doStartup method
      
    

HTTP ERROR 404

If eclipse asks where to save ''war'' one should point it to the folder where folder WEB-INF is located. This helped me to prevent a 404 error when requesting the default page of a GWTP application.

      
	HTTP ERROR 404

	Problem accessing /Test.html. Reason:

	NOT_FOUND
	Powered by Jetty://
      
    

Links on GWTP