5
votes

I'm using Eclipse Indigo on Win XP, Maven 3.0.3 and GWT 2.4. I created a GWT-Maven project and imported it into Eclipse following the instructions here -- http://mojo.codehaus.org/gwt-maven-plugin/user-guide/archetype.html. After I added an additional source folder (target/generated-sources/gwt, a step not mentioned in the instructions), I right-clicked on my project, selected "Run As" -> "Web Application" and got this error ...

Loading modules
   com.myco.clearing.product.ProductPlus
       [ERROR] Unable to find 'com/myco/clearing/product/ProductPlus.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

Do you have any ideas how I can configure Eclipse to solve this problem? I haven't done anything else other than the steps I mention.

The .gwt.xml file is created by the archetype and is located in the src/main/resources/war directory. Its contents are

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='ProductPlus'>
  <!-- Inherit the core Web Toolkit stuff.                        -->
  <inherits name='com.google.gwt.user.User' />

  <!-- We need the JUnit module in the main module,               -->
  <!-- otherwise eclipse complains (Google plugin bug?)           -->
  <inherits name='com.google.gwt.junit.JUnit' />

  <!-- Inherit the default GWT style sheet.  You can change       -->
  <!-- the theme of your GWT application by uncommenting          -->
  <!-- any one of the following lines.                            -->
  <inherits name='com.google.gwt.user.theme.standard.Standard' />
  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

  <!-- Other module inherits                                      -->

  <!-- Specify the app entry point class.                         -->
  <entry-point class='war.client.ProductPlus' />

  <!-- Specify the paths for translatable code                    -->
  <source path='client' /> 
  <source path='shared' />

</module>

Thanks, - Dave

1

1 Answers

4
votes

Try using m2Eclipse to run your app... because your app is Mavenized, you will probably run into trouble trying to run it with the GWT Eclipse Plugin. What I do is:

  • Right-click on your project folder
  • Select "Run As > Maven build...
  • This will let you create a new run configuration. If you only want to run the app, just add gwt:run to your goals. If you want to build then run, add something like clean install gwt:run to your goals.

Maybe this will also help: - Make sure that in Project > Properties > Google > Web Toolkit, you have the "Use Google Web Toolkit" checkbox selected (this should add the generated folder to your class path automatically". - Check that Eclipse knows this is a Maven project. If it is, you should have a folder called "Maven Dependencies". If it's not, right-click on your project, select Configure > Convert to Maven Project