Strange Error int gwt:compile compiling a test class

61 views
Skip to first unread message

Sean McRae

unread,
Jan 8, 2009, 3:48:39 PM1/8/09
to gwt-maven
I have just began using the gwt-maven plugin and I appreciate all the
work that has gone into it.

I am getting a strange error during the GWT compilation of my code
which was previously working fine under our old Ant build. The strange
part is that even though I get the error, the compilation is
successful and the unit tests run and all pass.

We have a class, BaseGwtTestCase, that extends GWTTestCase and
basically just sets the module name. The rest of our unit tests then
extend BaseGwtTestCase and exercise the unit.Here is what I get:

[ERROR] Line 10: The import
com.google.gwt.junit.client.GWTTestCase cannot be resolved
[ERROR] Line 19: GWTTestCase cannot be resolved to a type
[ERROR] Line 26: The method getModuleName() of type
BaseGwtTestCase must override a superclass method

I basically followed the sample 'multi project and composition sample'
pom for this project, but perhaps I missed some dependency or some
other setting?

I am using GWT-Maven plugin 2.0 beta 26, with GWT 1.5.3 and JDK 6.

Any suggestions would be greatly appreciated.

Sean

Charlie Collins

unread,
Jan 9, 2009, 11:17:51 AM1/9/09
to gwt-maven
That smells like a Java 5 issue running against Java 6 code.

Make sure your POM says to use Java 6 if you use @Override against an
Interface, or try removing the annotation (or look around in that
area, not positive).

http://blogs.sun.com/ahe/entry/override_snafu

Daniel Jue

unread,
Sep 22, 2009, 11:37:55 AM9/22/09
to gwt-...@googlegroups.com
Bringing this up from a long time ago. I am using GWT 1.7, Java
1.6.0_16, and Maven 2.0.10
I am getting this error in a maven multi module project, where the gwt
portion is a child module.

CN: In Java 1.6, you can use the @Override on implementations of
public interface methods.
However, when running a mvn clean install, the compile errors for GWT
look like this:

[ERROR] Line ##: The method [[method name]] of type xxx must override
a superclass method

where xxx implements yyy
and
yyy has a public interface method [[method name]]


The general advice is "You should set the compiler compatibility in your POM"
Well I did that, and it looks like this in the parent pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>

I read on here:
http://www.nabble.com/Tycho---java-compiler-configuration-not-propagated-from-parent-POM-td23425080.html
that
"java compiler configuration not propagated from parent POM"
So I tried putting the same

<source>1.6</source>
<target>1.6</target>

in the configuration of the gwt-maven-plugin. Still no luck.

From this GWT Issue ticket, it looks like this should have been fixed
in GWT 1.6:
http://code.google.com/p/google-web-toolkit/issues/detail?id=2223


Has anyone else running into this?
Is there a different pom option for specifying which compiler
compatibility version GWT should use?

ABork

unread,
Nov 3, 2009, 3:48:59 AM11/3/09
to gwt-maven
I have been running into this as well.

Have you had any luck solving the problem?



On Sep 22, 4:37 pm, Daniel Jue <teamp...@gmail.com> wrote:
> Bringing this up from a long time ago.  I am using GWT 1.7, Java
> 1.6.0_16, and Maven 2.0.10
> I am getting this error in a maven multi module project, where the gwt
> portion is a child module.
>
> CN:  In Java 1.6, you can use the @Overrideon implementations of
> public interface methods.
> However, when running a mvn clean install, the compile errors for GWT
> look like this:
>
> [ERROR] Line ##: The method [[method name]]  of type xxxmustoverride
> a superclass method
>
> where xxx implements yyy
> and
> yyy has a public interface method [[method name]]
>
> The general advice is "You should set the compiler compatibility in your POM"
> Well I did that, and it looks like this in the parent pom:
>                         <plugin>
>                                 <groupId>org.apache.maven.plugins</groupId>
>                                 <artifactId>maven-compiler-plugin</artifactId>
>                                 <configuration>
>                                         <source>1.6</source>
>                                         <target>1.6</target>
>                                 </configuration>
>                         </plugin>
>
> I read on here:http://www.nabble.com/Tycho---java-compiler-configuration-not-propaga...
> that
> "java compiler configuration not propagated from parent POM"
> So I tried putting the same
>
>                                         <source>1.6</source>
>                                         <target>1.6</target>
>
> in the configuration of the gwt-maven-plugin.  Still no luck.
>
> From this GWT Issue ticket, it looks like this should have been fixed
> in GWT 1.6:http://code.google.com/p/google-web-toolkit/issues/detail?id=2223
>
> Has anyone else running into this?
> Is there a different pom option for specifying which compiler
> compatibility version GWT should use?
>
> On Fri, Jan 9, 2009 at 12:17 PM, Charlie Collins
>
> <charlie.coll...@gmail.com> wrote:
>
> > That smells like a Java 5 issue running against Java 6 code.
>
> > Make sure your POM says to use Java 6 if you use @Overrideagainst an
> > Interface, or try removing the annotation (or look around in that
> > area, not positive).
>
> >http://blogs.sun.com/ahe/entry/override_snafu
>
> > On Jan 8, 3:48 pm, Sean McRae <sean.mc...@gmail.com> wrote:
> >> I have just began using the gwt-maven plugin and I appreciate all the
> >> work that has gone into it.
>
> >> I am getting a strange error during the GWT compilation of my code
> >> which was previously working fine under our old Ant build. The strange
> >> part is that even though I get the error, the compilation is
> >> successful and the unit tests run and all pass.
>
> >> We have a class, BaseGwtTestCase, that extends GWTTestCase and
> >> basically just sets the module name. The rest of our unit tests then
> >> extend BaseGwtTestCase and exercise the unit.Here is what I get:
>
> >>       [ERROR] Line 10: The import
> >> com.google.gwt.junit.client.GWTTestCase cannot be resolved
> >>       [ERROR] Line 19: GWTTestCase cannot be resolved to a type
> >>       [ERROR] Line 26: The method getModuleName() of type
> >> BaseGwtTestCasemustoverridea superclass method
Reply all
Reply to author
Forward
0 new messages