javax.xml.bind.UnmarshalException: Неожиданный элемент (URI: "", местные: "systemUnit") , Ожидаемые элементы < {http://xyz.abc.com/consumer/systems} systemUnit>javax.xml.bind.UnmarshalException: Неожиданный элемент (URI: "", местное: "systemUnit")
Meet исключение при демаршаллизации из XML
SystemUnit systemUnit;
{
final ByteArrayOutputStream originalStream = new ByteArrayOutputStream();
try {
final TeeInputStream tee = new TeeInputStream(new FileInputStream("E:/ws/test.xml"), originalStream);
try {
final JAXBContext jc = JAXBContext.newInstance(SystemUnit.class);
final Unmarshaller unmarshaller = jc.createUnmarshaller();
systemUnit = (SystemUnit)unmarshaller.unmarshal(tee);
System.out.println("Success"); // Pending NO exceptions during processing...
}
catch (final javax.xml.bind.JAXBException e) {
System.out.println("Exception came");
e.printStackTrace();
}
finally {
tee.close();
}
// contactLog.setMessage(originalStream.toByteArray());
}
finally {
originalStream.close();
}
}
У меня есть аннотаций @XmlRootElement (имя = " systemUnit ") к классам systemUnit.
может кто-нибудь помочь мне решить этот вопрос