Re: [Simple-support] Problem during deserializing
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-07-03 05:41:44
|
Hi,
I think you are missing some code here. You are likely missing a no-arg constructor, or you are trying to deserialize a non-static inner class. Or you have either a final field annotated or a getter method annotated without a setter method annotated.
Provide a complete listing of your source and I can answer here.
Niall
--- On Fri, 10/6/11, joh sar..... <eh...@gm...> wrote:
From: joh sar..... <eh...@gm...>
Subject: [Simple-support] Problem during deserializing
To: sim...@li...
Received: Friday, 10 June, 2011, 6:35 AM
Hi all,
Thanks for the library, it's very helpful and very efficient.
I am writing to you because I have a deserializing problem.
I try to deserializing a xml that i have serialized with your library and i don't find my bug.
May be someone could help me or give me a clue;
The log is : ERROR/erreur(15302): org.simpleframework.xml.core.PersistenceException: Constructor not matched for class construction_Xml_Data.IDE
where IDE is one of my class that i have implemented. I don't know why it did not find my class !
Thanks !
Johan
This is my code :
/-----------------------
@Root(strict = false)
public class Utilisateurs {
@ElementList(type = Medecin.class)
private ArrayList<Medecin> medecins;
@ElementList(type = IDE.class)
private ArrayList<IDE> ides;
... constructors and getters
------------------------------/
/---------------------------------
@Root
public class Medecin {
@Element
private String nom;
@Element
private String prenom;
@Element
private String specialite;
@Element
private int encours;
.... constructors and getters
-------------------------------------/
/---------------------------------------
@Root
public class IDE {
@Element
private String nom;
@Element
private String prenom;
@Element
private String specialite;
@Element
private int encours;
... constructor and getters
-------------------------------------------/
And that is the read code:
try {
Serializer serializer = new Persister();
File file = new File(path);
Utilisateurs util = serializer.read(Utilisateurs.class, file,false); <--- the problem and i'm sure that my path is good
} catch (Exception e) {
// TODO Auto-generated catch block
Log.e("erreur", "pas d'ecriture xml", e);
}
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|