2011-09-20 70 views
0

我有錯誤:爲什麼這個類不可序列化?

com.google.gwt.user.client.rpc.SerializationException: Type 'ru.xxx.empeditor.client.Dept$$EnhancerByCGLIB$$2f6af516' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = [email protected] 

爲什麼這個類不能序列?

package ru.xxx.empeditor.client; 

import java.util.HashSet; 
import java.util.Set; 

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

/** 
* Dept generated by hbm2java 
*/ 
public class Dept implements IsSerializable { 

    private byte deptno; 
    private String dname; 
    private String loc; 
    private Set<Emp> emps = new HashSet<Emp>(0); 

    public Dept() { 
    } 

    public Dept(byte deptno) { 
     this.deptno = deptno; 
    } 

    public Dept(byte deptno, String dname, String loc, Set<Emp> emps) { 
     this.deptno = deptno; 
     this.dname = dname; 
     this.loc = loc; 
     this.emps = emps; 
    } 

    public byte getDeptno() { 
     return this.deptno; 
    } 

    public void setDeptno(byte deptno) { 
     this.deptno = deptno; 
    } 

    public String getDname() { 
     return this.dname; 
    } 

    public void setDname(String dname) { 
     this.dname = dname; 
    } 

    public String getLoc() { 
     return this.loc; 
    } 

    public void setLoc(String loc) { 
     this.loc = loc; 
    } 

    public Set<Emp> getEmps() { 
     return this.emps; 
    } 

    public void setEmps(Set<Emp> emps) { 
     this.emps = emps; 
    } 

} 
+0

「Emp」類是可序列化的嗎?您能否展示其定義的概述? –

+1

它看起來像你使用某種形式的字節碼編織 - 也許是AOP? - 這是沒有序列化。 – parsifal

回答

相關問題