java.util.LinkedList.Node<;E>;无法分配给GWT Serializable?
当我试图编译我的GWT应用程序时,我遇到了很多错误。其中一些是java.util.LinkedList.Node<;E>;无法分配给GWT Serializable?,java,javascript,gwt,serialization,Java,Javascript,Gwt,Serialization,当我试图编译我的GWT应用程序时,我遇到了很多错误。其中一些是 [ERROR] com.google.gwt.xml.client.impl.AttrImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer. [ERROR] com.google.gwt.xml.c
[ERROR] com.google.gwt.xml.client.impl.AttrImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.CDATASectionImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.CommentImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.DocumentFragmentImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.DocumentImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.ElementImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.EntityReferenceImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.NamedNodeMapImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.NodeImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.NodeListImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.ProcessingInstructionImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] com.google.gwt.xml.client.impl.TextImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] java.util.AbstractList.SubList<E> is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] java.util.AbstractList.SubList<E> is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] java.util.Collections.UnmodifiableList<T> is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] java.util.Collections.UnmodifiableList<T> is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] java.util.Collections.UnmodifiableRandomAccessList<T> is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] java.util.Collections.UnmodifiableRandomAccessList<T> is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer.
[ERROR] java.util.LinkedList.Node<E> is not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' or 'java.io.Serializable' nor does it have a custom field serializer
[ERROR] java.util.LinkedList.Node<E> has no available instantiable subtypes.
[ERROR] subtype java.util.LinkedList.Node<E> is not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' or 'java.io.Serializable' nor does it have a custom field serializer
[ERROR]com.google.gwt.xml.client.impl.AttrImpl不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.CDATASectionImpl不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.CommentImpl不是默认的可实例化对象(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.DocumentFragmentImpl不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.DocumentImpl不是默认的可实例化的(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.ElementImpl不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.EntityReferenceImpl不是默认的可实例化的(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.NamedNodeMapImpl不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.NodeImpl不是默认可实例化的(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.NodeListImpl不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.ProcessingInstructionImpl不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]com.google.gwt.xml.client.impl.TextImpl不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]java.util.AbstractList.SubList不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]java.util.AbstractList.SubList不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]java.util.Collections.UnmodifiableList不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]java.util.Collections.UnmodifiableList不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]java.util.Collections.UnmodifiableRandomAccessList不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]java.util.Collections.UnmodifiableRandomAccessList不是默认的instantiable(它必须有零参数构造函数或根本没有构造函数),并且没有自定义序列化程序。
[错误]java.util.LinkedList.Node不能分配给'com.google.gwt.user.client.rpc.IsSerializable'或'java.io.Serializable',也没有自定义字段序列化程序
[错误]java.util.LinkedList.Node没有可用的可实例化子类型。
[错误]子类型java.util.LinkedList.Node不能分配给'com.google.gwt.user.client.rpc.IsSerializable'或'java.io.Serializable',也没有自定义字段序列化程序
我在客户端代码中得到了这个错误!无论我从互联网上读到什么,它都说我无法将JRE容器中运行的所有标准方法模拟到GWT,因为它将在运行时编译为Javascript。但我太没经验了,无法理解这个错误。非常感谢您的帮助 正如堆栈的第一行所说,要序列化,类需要有无参数的构造函数或自定义序列化程序。 下面是关于编写序列化程序的主题三条准则:
- GWT Java是Java,但不是Java
- GWT Java实际上是Java编译器友好的Javascript
- 实现Serializable可能不是GWT Serializable
class Spider
implements Serializable{
String a;
Integer b;
Cobweb c;
}
编译器将通过a和b运行,因为字符串已经有了自己的序列化编解码器(即编码器/解码器或封送器/解编器)。整数也是如此
然后,编译器尝试查看Cobweb是否通过提供自己的编解码器实现可序列化,或者Cobweb是否包含可序列化的成员,如
class Cobweb
implements Serializable{
Boolean d;
Double e;
}
由于Sun/Oracle对Java语言的管理,d和e都已经提供了序列化编解码器
如果蛛网允许泛型参数呢
class Cobweb <T>
implements Serializable{
Boolean d;
T e;
}
类蛛网
实现可序列化{
布尔d;
T e;
}
Cobweb
将是可序列化的,因为Java已经有了一个用于Float的序列化编解码器
但是,除非驴子有一个自定义的序列化编解码器,否则编译器会在以下情况下发出嘎嘎声
class Spider
implements Serializable{
String a;
Integer b;
Cobweb<Donkey> c;
}
类蜘蛛
实现可序列化{
字符串a;
整数b;
蛛网c;
}
GWT serialable是什么意思?
实现序列化还不够吗?为什么,谷歌正在实现一个新的可序列化接口?不。这是谷歌的错,但n
java.util.LinkedList.Node<E>