javax.xml.bind.UnmarshalException - with linked exception: [javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1] Message: Premature end of file.]

 javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Premature end of file.]

You are getting the error because the InputStream has been advanced to the end during the output

Here is the code I used


xmlValidatorService.setOpsReport(false);List errorList = 
    xmlValidatorService.runValidation(inputStream);
JAXBContext jaxbContext = JAXBContext.newInstance(WellsJaxb.class);
XMLStreamReader xsr = XMLInputFactory.newFactory().createXMLStreamReader
                                 (inputStream);
Unmarshaller um = jaxbContext.createUnmarshaller();
wellsJaxb = (WellsJaxb)  um.unmarshal(xsr);

No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days