java - 找到接口(interface) com.google.gwt.core.ext.typeinfo.JClassType,但应为类

标签 java gwt maven maven-plugin

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

Found interface com.google.gwt.core.ext.typeinfo.JClassType, but class was expected

它与 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 发布之前的版本,因此它不能自动与所有 future 版本兼容...

你有几个选择 - 最干净的是移动到更新版本的 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 最佳实践、更好的性能和更定期的更新。

关于java - 找到接口(interface) com.google.gwt.core.ext.typeinfo.JClassType,但应为类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12630987/

相关文章:

java - 将地址字符串转换为 GeoPt 值

java - 如何在依赖项目上强制安装maven?

java - Kotlin/Java - 货币类别的默认小数位

Java - 用一个字节索引到数组

browser - GWT 不支持的浏览器警告

spring - 如何整合Spring和Apache Jackrabbit?

java - 准备库 .jar 以使用 Maven 和 Git 发布

java - 无法在 org.eclipse.ui.internal.ViewReference.createErrorPart 处创建 View : Drag Placerholder; java. lang.Exception

java - 多级继承中的方法调用

java - 在 GWT 应用程序中包含 Guava GWT