【问题标题】:gwt error when try add IsSerializable in enum尝试在枚举中添加 IsSerializable 时出现 gwt 错误
【发布时间】:2013-04-20 16:25:23
【问题描述】:

您好,我尝试序列化我的枚举类,但是当我尝试编译我的项目时出现错误。

这是我的简单枚举:

import com.google.gwt.user.client.rpc.IsSerializable;

public enum ConversationType implements IsSerializable {

    PAIR, GROUP, ALL;

    ConversationType() {

    }

}

我的 pom 依赖项中也有 gwt-user:

<dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>2.5.0</version>
      <scope>provided</scope>
    </dependency>

在那个项目中,我得到了其他 DTO 对象,并且该对象实现了 IsSerializable。 当我从该枚举中删除 IsSerializable 时,一切都很好。

这是我的错误:

An exception has occurred in the compiler (1.7.0_13). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.google.gwt.user.client.rpc.IsSerializable not found

【问题讨论】:

    标签: gwt gwt-rpc


    【解决方案1】:

    所有枚举都可以通过 GWT-RPC 序列化,那么如果这会触发 javac 中的错误,您为什么要尝试使其实现 IsSerializable

    参考:https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication#DevGuideSerializableTypes

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-27
      • 1970-01-01
      • 2013-10-18
      • 1970-01-01
      • 2013-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多