unexpected element (uri:\"\", local:\"Group\"). Expected elements are <{}group>
Meet an exception when unmarshalling from xml
None of the solutions mentioned here worked for me, I was still getting:
Exception in thread "main" javax.xml.bind.UnmarshalException: unexpected element (uri:"java:XXX.XX.XX.XXX", local:"XXXXX")
After lot of research through other sites below code worked for me-
FileInputStream fis = new FileInputStream("D:/group.xml");
SOAPMessage message = factory.createMessage(new MimeHeaders(), fis);
JAXBContext jc = JAXBContext.newInstance(Group.class);
Unmarshaller u = jc.createUnmarshaller();
JAXBElement r = u.unmarshal(message.getSOAPBody().extractContentAsDocument(), Group.class);
Group group = r.getValue();