`
wendy_wxie
  • 浏览: 117839 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

"Class Type' was not included in the set of types which can be serialized ...

    博客分类:
  • Gxt
阅读更多

今天做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:

  1. Verify that the class has a default constructor (without arguments)
  2. Verify that the class implements Serializable or IsSerializable or implements an Interface that extends Serializable or extends a class that implement Serializable
  3. Verify that the class is in a client.* package or …
  4. 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
  5. 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
  6. 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.

 

 

分享到:
评论

相关推荐

    Dundas.Chart.for.Winform.Enterprise.v7.1.0.1812.for.VS2008

    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 ...

    googleGson JsonObject json转换包

    包含以下java源文件: com.google.gson.DefaultDateTypeAdapter.class com.google.gson.ExclusionStrategy.class com.google.gson.FieldAttributes.class com.google.gson.FieldNamingPolicy.class ...

    php.ini-development

    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 ...

    VB.NET多款风格渐变和无规则按钮

    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 ...

    json.js_json2.js

    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, ...

    acpi控制笔记本风扇转速

    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 ...

    RESTful Web Services.rar

    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. ...

    解决Django响应JsonResponse返回json格式数据报错问题

    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,使其接受列表 补充知识:...

    Json.net for .net3.5

    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 ...

    JESD204B_Standard.pdf

    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:

    JESD204C_Standard.pdf

    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:

    iOS Fuondation Framework Reference

    **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 ...

    easyload 9.0

    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 ...

    Odin – Inspector and Serializer v3.0.9

    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

    Visual C++ 编程资源大全(英文源码 控件)

    (19KB)&lt;END&gt;&lt;br&gt;46,treestore.zip Tree views are capable of storing hierarchical data, which isn't intuitively serialized. (41KB)&lt;END&gt;&lt;br&gt;47,writeres.zip This console application shows how to ...

    Interview Questions in Core Java

    Interview Questions in Core Java 1.what is a transient variable? A transient variable is a variable that may not be serialized.

    mapx 反序列化读取数据

    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 ...

    XVR_Serializer:XVR 应用程序的对象序列化程序

    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 = ...

    JSON开发包PowerJSON.zip

     // 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))] ...

Global site tag (gtag.js) - Google Analytics