posted 11 years ago
After generating the code from XJC, I changed my Unmarshal code as below.
JAXBContext jaxbContext = JAXBContext.newInstance(jaxbPackageInstance);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
// return (Setup)unmarshaller.unmarshal(dataHandler.getDataSource().getInputStream()); /* Original Code */
JAXBElement<Setup> root = unmarshaller.unmarshal(new StreamSource(dataHandler.getDataSource().getInputStream()), Setup.class);
return root.getValue();
Instead of return (Setup)unmarshaller.unmarshal(dataHandler.getDataSource().getInputStream()); I added the new 2 lines to resolve the unmarshaller error.