Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.simpleframework.xml.core.PersistenceException: Constructor not matched for class A

I am using SimpleXML to serialize(write to XML) without any problem. But, when I try to read and deserialize to XML I get following exception. I am using lombok plugin to give constructors such as " @RequiredArgsConstructor".

The error message is : "org.simpleframework.xml.core.PersistenceException: Constructor not matched for class A".

If you want I can provide codes for more detailed information

like image 916
Tonyukuk Avatar asked Feb 27 '17 12:02

Tonyukuk


1 Answers

Does the class A have a constructor without arguments? Those are needed for deserialization (can private though).

If you have only constructors with argument, the serializer can't create default constructed objects on reading. As this is not necessary on writing, you don't get the error there.

like image 193
ollo Avatar answered Sep 21 '22 11:09

ollo