I’m trying to run a legacy project using Maven with gwt-maven-plugin. I have the following error
Found interface com.google.gwt.core.ext.typeinfo.JClassType, but class was expected
It is connected with GWT 2.4.0. There were some answers about downgrading GWT or recompiling gwtp, but I don’t understand them.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>i18n</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>someTarget.html</runTarget>
<hostedWebapp>${webappDir}</hostedWebapp>
<i18nMessagesBundle>org.I18nMsg</i18nMessagesBundle>
</configuration>
</plugin>
<pluginManagement>
<plugins>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
gwt-maven-plugin
</artifactId>
<versionRange>
[2.4.0,)
</versionRange>
<goals>
<goal>i18n</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute></execute>
</action>
</pluginExecution>
</pluginExecutions>
....
Error:
[INFO] Scanning for additional dependencies: jar:file:/C:/Users/xxx/.m2/repository/com/extjs/gxt/2.2.0/gxt-2.2.0.jar!/com/extjs/gxt/ui/client/core/El.java
[INFO] Computing all possible rebind results for 'com.extjs.gxt.ui.client.core.impl.ComputedStyleImpl'
[INFO] Rebinding com.extjs.gxt.ui.client.core.impl.ComputedStyleImpl
[INFO] Could not find an exact match rule. Using 'closest' rule <replace-with class='com.extjs.gxt.ui.client.core.impl.ComputedStyleImplIE'/> based on fall back values. You may need to implement a specific binding in case the fall back behavior does not replace the missing binding
[INFO] Rebinding com.extjs.gxt.ui.client.core.impl.ComputedStyleImpl
[INFO] Could not find an exact match rule. Using 'closest' rule <replace-with class='com.extjs.gxt.ui.client.core.impl.ComputedStyleImplIE'/> based on fall back values. You may need to implement a specific binding in case the fall back behavior does not replace the missing binding
[INFO] [ERROR] Errors in 'jar:file:/C:/Users/xxx/.m2/repository/com/extjs/gxt/2.2.0/gxt-2.2.0.jar!/com/extjs/gxt/ui/client/data/BeanModelLookup.java'
[INFO] [ERROR] Internal compiler error
[INFO] java.lang.IncompatibleClassChangeError: Found interface com.google.gwt.core.ext.typeinfo.JClassType, but class was expected
GWT made several breaking changes in their APIs in the last year or two, and you are running into one made around GWT 2.2. The GXT version you are using is from before GWT 2.2 was released, so it can’t automatically be compatible with all future versions…
You’ve got a few choices – cleanest would be to move to a newer version of GXT – the more recent 2.2.x versions have three different jars in them, you need the -22 version, as that is compatible with GWT 2.2.0 and onward to current (2.5.0-rc1 at the time of writing).
If you can’t update to a newer GXT version, consider recompiling GXT against your version of GWT. Only a few classes need to be recompiled, mostly the ones in
com.extjs.gxt.ui.rebind.And if this is a brand new project, consider GXT 3 – makes better use of GWT best practices, better performance, and more regular updates than the 2.x series.