该示例是使用 GWT 和 Objectify 版本 5.0.3 实现的。 当我尝试保存文档实例时会产生这种情况。 我收到错误:
无法获取 Line 类的类型签名
你有一个想法吗?
@SuppressWarnings("serial")
@Entity
public class GenericEntity implements Serializable {
@Id protected Long id;
}
@SuppressWarnings("serial")
@Entity
public class Document extends GenericEntity implements Serializable {
@Index private String name;
@Serialize private List<Session> sessions = new ArrayList<Session>();
}
@SuppressWarnings("serial")
@Entity
public class Session extends GenericEntity implements Serializable {
private Date date;
@Serialize private Vector<Line> transectsH = new Vector<Line>();
@Serialize private HashMap<Point, Line> mapperHorizontalLines = newHashMap<Point, Line>();
}
@SuppressWarnings("serial")
@Entity
public class Point extends GenericEntity implements Serializable {
private double x;
private double y;
}
@SuppressWarnings("serial")
@Entity
public class Line extends GenericEntity implements Serializable {
private Point coordinate;
private Image image;
private Object data;
}
最佳答案
当您尝试序列化某些内容时,您会收到 GWT 的异常。可能是因为 GWT-RPC 无法序列化 Object
类型声明的内容。
关于java - 无法获取类包的类型签名..Line,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25003814/