The clue is in
path : /MessageFieldMappings/RootMapping
line number : 3
You've aliased MessageFieldMappings
to class A
, so when it sees a MessageFieldMappings
it will call the converter, which will moveDown
to the RootMapping
element and attempt to extract a key
attribute from that. It doesn't have one, hence the NPE.
You need an extra level of moveDown/Up in the converter:
reader.moveDown(); // RootMapping
reader.moveDown(); // First FieldMap
A n = new A(reader,context);
reader.moveUp();
reader.moveUp();
return n;