Search code examples
javajaxbspring-batchstax

Using StaxEventItemReader with jaxb2 unmarshaller


I have xml that looks like this

<Items>
  <Item>
  <Item>
</Items>

And i have xsd for this structure and have generated coresponding class using xjc (so Items is rootElement)

problem is that StaxEventItemReader needs a way to unmarshall just <Item></Item> and take it as root element, so jaxb2 unmarshallers throws error that it expects Items but got Item.


Solution

  • Problem solved in spring-oxm 3.2.3.