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

时间:2012-09-27 22:30:40

标签: java gwt maven maven-plugin

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

  

找到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

1 个答案:

答案 0 :(得分:5)

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最佳实践,更好的性能和更多定期更新。