2011-09-20 8 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

답변

1

클래스 Emp이 serializable인지 확인하십시오.

GWT가 직렬화하지 못해 결과적으로 빈의 바이트 코드를 변경하는 프록시 때문에 다른 잠재적 인 문제 (Hibernate를 사용 중이므로 자동 생성 주석이 있음)가 원인 일 수 있습니다. 언급 한 바와 같이 - http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html

관련 문제