After importing project: "GreetingServiceAsync cannot be resolved to a type"

1,618 views
Skip to first unread message

laredotornado

unread,
Nov 1, 2011, 2:53:03 PM11/1/11
to Codehaus Mojo gwt-maven-plugin Users
Hi,

I'm using Eclipse Indigo on Win XP, Java 6, Maven 3.0.3 and GWT 2.4.
Per the instructions here -- http://mojo.codehaus.org/gwt-maven-plugin/user-guide/archetype.html,
I was successfully able to create a GWT maven project using the
command

mvn archetype:generate \
-DarchetypeRepository=repo1.maven.org \
-DarchetypeGroupId=org.codehaus.mojo \
-DarchetypeArtifactId=gwt-maven-plugin \
-DarchetypeVersion=2.4.0

I installed the M2Eclipse and the Google Eclipse plugins. Then when I
went to import my project using File -> Import -> Existing Maven
Projects, the project imports with errors. For example, Eclipse
reports this compile error on line 35 in my src/main/java/war/client/
Module.java file ...

GreetingServiceAsync cannot be resolved to a type

Did I forget to do something or is this how it is for everyone? What
is the agreed solution? Thanks, - Dave

Jesse Farinacci

unread,
Nov 1, 2011, 6:10:27 PM11/1/11
to codehaus-mojo-gwt-...@googlegroups.com
Greetings,

On Tue, Nov 1, 2011 at 2:53 PM, laredotornado <laredo...@zipmail.com> wrote:
> GreetingServiceAsync cannot be resolved to a type
> Did I forget to do something or is this how it is for everyone?  What
> is the agreed solution?  Thanks, - Dave

Did you add target/generated-sources/gwt to the Eclipse build path?
This is not done automatically, unfortunately.

-Jesse

--
There are 10 types of people in this world, those
that can read binary and those that can not.

laredotornado

unread,
Nov 2, 2011, 9:27:42 AM11/2/11
to Codehaus Mojo gwt-maven-plugin Users
Right on. That solved the Eclipse warnings. But I've stumbled on
another problem. When I right-click on my project and select "Run As"
-> "Web Applications" I get the error in the Eclipse console ...

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

This is strange because the archetype created the .gwt.xml file in the
src/main/resources/war directory but that's not getting picked up for
some reason. Thoughts?

Thanks, - Dave



On Nov 1, 5:10 pm, Jesse Farinacci <jie...@gmail.com> wrote:
> Greetings,
>

Jesse Farinacci

unread,
Nov 2, 2011, 9:57:35 AM11/2/11
to codehaus-mojo-gwt-...@googlegroups.com
Greetings,

On Wed, Nov 2, 2011 at 9:27 AM, laredotornado <laredo...@zipmail.com> wrote:
> Right on.  That solved the Eclipse warnings.  But I've stumbled on
> another problem.  When I right-click on my project and select "Run As"
> -> "Web Applications" I get the error in the Eclipse console ...

This is a known issue with Google Eclipse Plugin (GEP), see
http://mojo.codehaus.org/gwt-maven-plugin/eclipse/google_plugin.html

laredotornado

unread,
Nov 2, 2011, 4:22:09 PM11/2/11
to Codehaus Mojo gwt-maven-plugin Users
Are you sure this is the right link? I don't see anything on this
page about the error I'm experiencing or how to fix. Is there a way
to fix it? Thanks, - Dave

On Nov 2, 8:57 am, Jesse Farinacci <jie...@gmail.com> wrote:
> Greetings,
>
> On Wed, Nov 2, 2011 at 9:27 AM,laredotornado<laredotorn...@zipmail.com> wrote:
> > Right on.  That solved the Eclipse warnings.  But I've stumbled on
> > another problem.  When I right-click on my project and select "Run As"
> > -> "Web Applications" I get the error in the Eclipse console ...
>
> This is a known issue with Google Eclipse Plugin (GEP), seehttp://mojo.codehaus.org/gwt-maven-plugin/eclipse/google_plugin.html

Jesse Farinacci

unread,
Nov 3, 2011, 9:45:10 AM11/3/11
to codehaus-mojo-gwt-...@googlegroups.com
Greetings,

On Wed, Nov 2, 2011 at 4:22 PM, laredotornado <laredo...@zipmail.com> wrote:
> Are you sure this is the right link?  I don't see anything on this
> page about the error I'm experiencing or how to fix.  Is there a way
> to fix it?  Thanks, - Dave

I think the problem you are describing fits:

"A restriction of this plugin is that it will search for gwt modules
and host pages only in the first classpath source folder. Using a
Maven / Eclipse integration like m2eclipse, this one will be your
sourceDirectory (src/main/java). You'll have to move your gwt.xml
files in this folder, instead of the standard Maven resource
directory. See Google Eclipse Plugin issue #1597"

Daniel M

unread,
Nov 8, 2011, 9:22:29 PM11/8/11
to Codehaus Mojo gwt-maven-plugin Users
On Nov 3, 1:45 pm, Jesse Farinacci <jie...@gmail.com> wrote:
> Greetings,
>
Do you know if this issue have been fixed? I'm not seeing it? I'm
running Eclipse Classic 3.7.1 + m2eclipse + google plugin and it picks
up my resource folder from the build path.

Original poster, try this:

1. Generate a clean project from the archetype (from the command
line).
2. Delete all eclipse related files, so you end up with only src/ and
pom.xml
3. Import the maven project into eclipse
4. Do a mvn gwt:run
5. Add the generated sources folder to your build path
6. Setup the Google plugin (add your webapps directory, and enable gwt
support (point it to your maven managed gwt sdk))
7. Do a "run as" google web application (this will fail)
8. Edit your run configuration which was created by step 7, goto the
arguments tab and replace "ProductPlus" with
"com.myco.clearing.product.ProductPlus"

This works for me :)


Reply all
Reply to author
Forward
0 new messages