找到接口com.google.gwt.core.ext.typeinfo.JClassType,但类是预期的



我正在尝试使用 Maven 和 gwt-maven-plugin 运行一个遗留项目。我有以下错误

找到接口com.google.gwt.core.ext.typeinfo.JClassType,但类是预期的

它与GWT 2.4.0连接。有一些关于降级GWT或重新编译gwtp的答案,但我不明白。

<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>
....

错误:

[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 在过去一两年中对其 API 进行了几次重大更改,您遇到了大约 GWT 2.2 进行的更改。您使用的 GXT 版本是在 GWT 2.2 发布之前发布的,因此它不能自动与所有未来的版本兼容......

您有几个选择 - 最干净的是迁移到较新版本的 GXT - 最近的 2.2.x 版本包含三个不同的 jar,您需要 -22 版本,因为它与 GWT 2.2.0 兼容,并更高版本到当前版本(撰写本文时为 2.5.0-rc1)。

如果无法更新到较新的 GXT 版本,请考虑针对您的 GWT 版本重新编译 GXT。只有少数类需要重新编译,主要是com.extjs.gxt.ui.rebind中的类。

如果这是一个全新的项目,请考虑GXT 3 - 比2.x系列更好地利用GWT最佳实践,更好的性能和更定期的更新。

最新更新