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 '' could not be found in the web app, but was found on the system classpath''. I quick search brings up Web App Classpath Problem.


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
	Loading inherited module ''
	[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
	[ERROR] shell failed in doStartup method


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.


	Problem accessing /Test.html. Reason:

	Powered by Jetty://

Links on GWTP