今天做GXT项目遇到这个问题
"Class Type' was not included in the set of types which can be serialized ...
搞了半天没搞清楚原因,好不容易google解决了。
首先,检查自己在web目录下即前台的controller中返回给前台界面代码的bean是继承与gxt model对象的bean。gxt提供了很多种bean model,让你去继承或者实现。
其次,检查这些继承的beanmodel是不是有默认构造函数。
第三,检查这些beanmodel是不是内嵌了list之类的对象,比如gxt提供的Beanmodel这个对象是不支持内嵌list bean
的。除非这个内嵌的list bean对象实现了 BeanModelTag 接口
Nested beans are supported when creating BeanModel instances with limited
* support for nested lists of beans. Any child lists must be defined with
* java.util.List and must be paramertized with a BeanModelTag class or
* subclass.
不然很大可能会报NullPoint Exception。
最后修正一下,需要检查的步骤:
The problem may have different causes. Here his a complete check list to use for solving the problem:
- Verify that the class has a default constructor (without arguments)
- Verify that the class implements Serializable or IsSerializable or implements an Interface that extends Serializable or extends a class that implement Serializable
- Verify that the class is in a client.* package or …
- Verify, if the class is not in client.* package, that is compiled in your GWT xml module definition. By default <source path=”client” /> is present. If your class is in another package you have to add it to source. For example if your class is under domain.* you should add it to xml as <source path=”domain” /> . Be aware that the class cannot belong to server package! More details on GWT page: http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml
- If you are including the class from another GWT project you have to add the inherits to your xml module definition. For example if your class Foo is in thepackage com.dummy.domain you have to add <inherits name=”com.dummy.domain.Foo”/> to the module definition. More details here: http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideInheritingModules
- If you are including the class from another GWT project released as a jar verify that the jar contains also the source code because GWT recompile also the Java source for the classes passed to the Client.
分享到:
相关推荐
The Radial Gap offers the option of providing a hole in the center of the Rose Chart - a subtle change, but it offers a similar visual difference in the way a Pie Chart can become a Doughnut Chart ...
包含以下java源文件: com.google.gson.DefaultDateTypeAdapter.class com.google.gson.ExclusionStrategy.class com.google.gson.FieldAttributes.class com.google.gson.FieldNamingPolicy.class ...
Note that this directive does not control the , which can be ; used regardless of this directive. ; Default Value: On ; Development Value: Off ; Production Value: Off ; http://php.net/short-open-tag ...
For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can ...
used to select the members to be serialized. It filters the results such that only members with keys listed in the replacer array are stringified. Values that do not have JSON representations, ...
Enhanced the implementation of the "serialized mode" of the interpreter (enabled via the AcpiGbl_AllMethodsSerialized flag.) When this mode is specified, instead of creating a serialization semaphore ...
a simple set of principles that every day developers can use to connect applications in a style native to the Web. Table of Contents Foreword........ . . . xi Preface........ . . . xiii 1. ...
TYPEERROR: In order to allow non-dict objects to be serialized set the safe parmeter to False 解决: return JsonResponse({“name”: “tom”}, safe=False) 增加safe=false,使其接受列表 补充知识:...
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ...
This specification describes a serialized interface between data converters and logic devices.... In addition, converter functionality (ADC or DAC) can be distributed over multiple devices:
This specification describes a serialized interface between data converters and logic devices.... In addition, converter functionality (ADC or DAC) can be distributed over multiple devices:
**Overview**: `NSAffineTransform` is a class that represents an affine transformation matrix, which can be used to perform various geometric transformations such as scaling, rotation, and translation ...
Type that can be stored in the column. MapInfo Spatial Object Format 1.x: Point layer in X/Y columns indexed with micode (a serialized quadtree key) 2.x: Oracle MD/SDO version 1 HHCODE_ - Not ...
or add a few lines of code to your existing class, and everything serializable shall be serialized. Yes, even polymorphic types! Odin serialized prefabs are deprecated in 2018.3+ due to
(19KB)<END><br>46,treestore.zip Tree views are capable of storing hierarchical data, which isn't intuitively serialized. (41KB)<END><br>47,writeres.zip This console application shows how to ...
Interview Questions in Core Java 1.what is a transient variable? A transient variable is a variable that may not be serialized.
Since datasets rely on external data, the contents of the datasets are not serialized to the file along with the rest of the map's information. DataSets.Restore can be used to restore a dataset (and ...
object_to_be_serialized . id = 1 ; object_to_be_serialized . name = "Father" ; object_to_be_serialized . arr = { true , 2 , "Lorem" } ; child_obj . name = "Child" ; object_to_be_serialized . child = ...
// marks the serialized name of Identifier will be "a", if its type is ClassA, // and "b" for ClassB, and "variant" for other types [JsonField ("a", typeof (ClassA))] ...