I've created a ticket here that explains the issue I am experiencing https://bugs.eclipse.org/bugs/show_bug.cgi?id=460541
Essentially if we have an @XmlElementWrapper with @XmlElements then when unmarshalling if XML element is empty the setter on the JAXB object is never called to set an empty collection. This works with JAXB RI.
Example method and annotation definition:
@XmlElementWrapper(nillable=true)
@XmlElements(value = {@XmlElement(name="subelement", type=SubElement.class), @XmlElement(name="subsubelemenet", type=SubTypeOfSubElement.class)})
public List<SubElement> getSubElementCollectionWithSubType() {
return subElementCollectionWithSubType;
}
I would be very happy to hear any workaround if there is one other than removing the @XmlElements all together.