Jaxb marshelling not working



I have an abstract class A that has two implementation A1 and A2. Three class has the Jaxb annotation needed to be marshalled (XmlRootElement,XmllAccessor ... ).


Class B has bidirectional one to many relation with A



@XmlElementRef
@XmlInverseReference(mappedBy="b");
List<A> As;


when i marshell B , the Abstract A i marshelled and not the concrete one , so the fields in A1 and A2 didn't marshelled. i tried to annotate the List with XmlElementRef but Invalid XmlElementRef on property data is thrown stating that Referenced Element not declared.


I am using Moxy.


No comments:

Post a Comment