[GWT 1.7] Pb de serialisation
Bonjour à tous.
La classe suivante ne passe pas les appels distants car "non serialisable" 8O !!!
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| package my.package;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Vector;
import com.google.gwt.user.client.rpc.IsSerializable;
public class CDP implements IsSerializable {
public class Histo implements IsSerializable {
private String _auteur;
private Date _date;
public Histo() {}
public Histo(Date histoDate,String histoAuteur) {
_date = histoDate;
_auteur=histoAuteur;
}
}
private String _numero;
private String _identifiant;
private HashMap<java.util.Date, my.package.CDP.Histo>
_histo = new HashMap<Date, Histo>();
public CDP() {}
public CDP(String numero, String identifiant, Date histoDate, String histoAuteur) {
_numero=numero;
_identifiant=identifiant;
addHisto(histoDate,histoAuteur);
}
public void addHisto(Date histoDate,String histoAuteur) {
Histo histo = new Histo(histoDate,histoAuteur);
_histo.put(histoDate,histo);
}
} |
Le message est : [ERROR] Type 'my.package.CDP.Histo' was not serializable and has no concrete serializable subtypes
Cependant si je mets en commentaire ma HashMap
Code:
1 2
| // private HashMap<java.util.Date, my.package.CDP.Histo>
// _histo = new HashMap<Date, Histo>(); |
Ca passe !!!
Quelle est mon erreur ?
Merci de votre aide.