Skip to content
Advertisement

javax.xml.bind.UnmarshalException: unexpected element (uri:””, local:”Group”)

JavaScript

Meet an exception when unmarshalling from xml

JavaScript

Group class has no any annotation and group.xml just contains data.

Anything can be the cause?

Advertisement

Answer

It looks like your XML document has the root element “Group” instead of “group”. You can:

  1. Change the root element on your XML to be “group”
  2. Add the annotation @XmlRootElement(name=”Group”) to the Group classs.
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement